myInfo.vue 25 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063
  1. <template>
  2. <view class="content">
  3. <u-loading-page loading-mode='spinner' image="/static/imgs/logo.png" iconSize='60'
  4. :loading='loading'></u-loading-page>
  5. <view v-show='!loading'>
  6. <view class="card-list content1">
  7. <view class="row" v-for="(item,index) in cardList" :key="index">
  8. <view class="title-name">
  9. {{item.cardBusiness}}
  10. </view>
  11. <view class="card-list-item"
  12. :style="item.currentBackground?'background:url('+item.currentBackground+');background-size:100% 100%':''">
  13. <view class="card-content style1" v-if="item.cuttentTemplate==1">
  14. <view class="left">
  15. <u--image :showLoading="true"
  16. :src="item.headSculpture?item.headSculpture:'/static/imgs/card/defaulthead.png'"
  17. width="66px" height="66px" shape="circle"></u--image>
  18. </view>
  19. <view class="right">
  20. <view class="row1">
  21. <text class="name">{{item.name}}</text>
  22. <text class="post">{{item.post}}</text>
  23. </view>
  24. <view class="row2">
  25. {{item.companyName}}
  26. </view>
  27. <view class="row3 flex">
  28. <u--image :showLoading="true" :src="'/static/imgs/card/address'+item.icon+'.png'"
  29. width="13px" height="16px"></u--image>
  30. <view class='icon-text'>{{ item.province }}{{ item.city }}{{ item.area }}</view>
  31. </view>
  32. <view class="row4 flex">
  33. <u--image :showLoading="true" :src="'/static/imgs/card/phone'+item.icon+'.png'"
  34. width="12px" height="13px"></u--image>
  35. <view class='icon-text'>{{ item.phone }}</view>
  36. </view>
  37. <view class="row4 flex">
  38. <u--image :showLoading="true" :src="'/static/imgs/card/remark'+item.icon+'.png'"
  39. width="10px" height="12px"></u--image>
  40. <view class='icon-text'>{{item.remark?item.remark:'--'}}</view>
  41. </view>
  42. <!-- <view class="">
  43. 备注
  44. </view> -->
  45. </view>
  46. </view>
  47. <view class="card-content style1 flex-between" v-if="item.cuttentTemplate==2">
  48. <view class="right">
  49. <view class="row1">
  50. <text class="name">{{item.name}}</text>
  51. <text class="post">{{item.post}}</text>
  52. </view>
  53. <view class="row2">
  54. {{item.companyName}}
  55. </view>
  56. <view class="row3 flex">
  57. <u--image :showLoading="true" :src="'/static/imgs/card/address'+item.icon+'.png'"
  58. width="13px" height="16px"></u--image>
  59. <view class='icon-text'>{{ item.province }}{{ item.city }}{{ item.area }}</view>
  60. </view>
  61. <view class="row4 flex">
  62. <u--image :showLoading="true" :src="'/static/imgs/card/phone'+item.icon+'.png'"
  63. width="12px" height="13px"></u--image>
  64. <view class='icon-text'>{{ item.phone }}</view>
  65. </view>
  66. <view class="row4 flex">
  67. <u--image :showLoading="true" :src="'/static/imgs/card/remark'+item.icon+'.png'"
  68. width="10px" height="12px"></u--image>
  69. <view class='icon-text'>{{item.remark?item.remark:'--'}}</view>
  70. </view>
  71. <!-- <view class="">
  72. 备注
  73. </view> -->
  74. </view>
  75. <view class="left">
  76. <u--image :showLoading="true" :src="item.headSculpture" width="66px" height="66px"
  77. shape="circle" v-if="item.headSculpture"></u--image>
  78. <u--image :showLoading="true" src="/static/imgs/card/defaulthead.png" width="66px"
  79. height="66px" shape="circle" v-else></u--image>
  80. </view>
  81. </view>
  82. <view class="card-content style2" v-if="item.cuttentTemplate==3">
  83. <view class="top">
  84. <u--image :showLoading="true" :src="item.headSculpture" width="66px" height="66px"
  85. shape="circle" v-if="item.headSculpture"></u--image>
  86. <u--image :showLoading="true" src="/static/imgs/card/defaulthead.png" width="66px"
  87. height="66px" shape="circle" v-else></u--image>
  88. </view>
  89. <view class="bottom flex">
  90. <view class="left">
  91. <view class="row1">
  92. <text class="name">{{item.name}}</text>
  93. <text class="post">{{item.post}}</text>
  94. </view>
  95. <view class="row2">
  96. {{item.companyName}}
  97. </view>
  98. </view>
  99. <view class="right">
  100. <view class="row3 flex">
  101. <u--image :showLoading="true"
  102. :src="'/static/imgs/card/address'+item.icon+'.png'" width="13px"
  103. height="16px"></u--image>
  104. <view class='icon-text'>{{ item.province }}{{ item.city }}{{ item.area }}</view>
  105. </view>
  106. <view class="row4 flex">
  107. <u--image :showLoading="true" :src="'/static/imgs/card/phone'+item.icon+'.png'"
  108. width="12px" height="13px"></u--image>
  109. <view class='icon-text'>{{ item.phone }}</view>
  110. </view>
  111. <view class="row4 flex">
  112. <u--image :showLoading="true" :src="'/static/imgs/card/remark'+item.icon+'.png'"
  113. width="10px" height="12px"></u--image>
  114. <view class='icon-text'>{{item.remark?item.remark:'--'}}</view>
  115. </view>
  116. </view>
  117. </view>
  118. </view>
  119. <view class="card-content style2" v-if="item.cuttentTemplate==4">
  120. <view class="top">
  121. <view class="row1">
  122. <text class="name">{{item.name}}</text>
  123. <text class="post">{{item.post}}</text>
  124. </view>
  125. <view class="row2">
  126. {{item.companyName}}
  127. </view>
  128. </view>
  129. <view class="bottom flex">
  130. <view class="left">
  131. <u--image :showLoading="true" :src="item.headSculpture" width="66px" height="66px"
  132. shape="circle" v-if="item.headSculpture"></u--image>
  133. <u--image :showLoading="true" src="/static/imgs/card/defaulthead.png" width="66px"
  134. height="66px" shape="circle" v-else></u--image>
  135. </view>
  136. <view class="right">
  137. <view class="row3 flex">
  138. <u--image :showLoading="true"
  139. :src="'/static/imgs/card/address'+item.icon+'.png'" width="13px"
  140. height="16px"></u--image>
  141. <view class='icon-text'>{{ item.province }}{{ item.city }}{{ item.area }}</view>
  142. </view>
  143. <view class="row4 flex">
  144. <u--image :showLoading="true" :src="'/static/imgs/card/phone'+item.icon+'.png'"
  145. width="12px" height="13px"></u--image>
  146. <view class='icon-text'>{{ item.phone }}</view>
  147. </view>
  148. <view class="row4 flex">
  149. <u--image :showLoading="true" :src="'/static/imgs/card/remark'+item.icon+'.png'"
  150. width="10px" height="12px"></u--image>
  151. <view class='icon-text'>{{item.remark?item.remark:'--'}}</view>
  152. </view>
  153. </view>
  154. </view>
  155. </view>
  156. <view class="car-bottom flex">
  157. <view class="left">
  158. <image src="../../static/imgs/card/home.png" mode="widthFix"
  159. style="width: 32rpx;height: auto;" @click="toHome(item)"></image>
  160. <image src="../../static/imgs/card/share.png" mode="widthFix"
  161. style="width: 35rpx;height: auto;" @click="share(item)"></image>
  162. <image src="../../static/imgs/card/ewm.png" mode="widthFix"
  163. style="width: 32rpx;height: auto;" @click="showCode(item)"></image>
  164. </view>
  165. <view class="right">
  166. <text class="text" @click="topMarking(item)">置顶</text>
  167. <text class="text" @click="del(item.id)">删除</text>
  168. <text class="text" @click="toEditCard(item)">编辑</text>
  169. </view>
  170. <!-- <u-button text="置顶" @click="topMarking(item)" throttle-time='1000'></u-button> -->
  171. <!-- <button @click="$u.debounce(topMarking, 500)">置顶</button> -->
  172. <!-- <button @click="$u.debounce(topMarking(item), 500)">置顶</button> -->
  173. <!-- <u-button text="删除" @click="del(item.id)" throttle-time='1000'></u-button> -->
  174. <!-- <button @click="toEditCard(item)">编辑</button> -->
  175. </view>
  176. </view>
  177. </view>
  178. </view>
  179. <view class="upload flex flex-all-center" @click="addCard">
  180. <view class="solids flex flex-all-center">
  181. <image src="../../static/imgs/card/add.png" mode="widthFix" style="width: 148rpx;height: auto;">
  182. </image>
  183. <text class='text'>添加新名片</text>
  184. </view>
  185. </view>
  186. </view>
  187. <u-toast ref="uToast"></u-toast>
  188. <u-popup :round='10' :show="isShowDel" @close="isShowDel=false" mode="center">
  189. <view class="del-style">
  190. <text class="title">删除名片自动退出关联得圈子,确定删除?</text>
  191. <view class="">
  192. <view @click='radiovalue=1' class="flex align-item-center radio-wrap">
  193. <image style='width:13px;height:13px;margin-right:10rpx;'
  194. :src="radiovalue==1?'../../static/imgs/mySet/checked.png':'../../static/imgs/mySet/not-checked.png'"
  195. mode=""></image>
  196. <view class="">仅从自己名片列表删除</view>
  197. </view>
  198. <view @click='radiovalue=2' class="flex align-item-center radio-wrap">
  199. <image style='width:13px;height:13px;margin-right:10rpx;'
  200. :src="radiovalue==2?'../../static/imgs/mySet/checked.png':'../../static/imgs/mySet/not-checked.png'"
  201. mode=""></image>
  202. <view class="">从所有拥有此名片用户列表删除</view>
  203. </view>
  204. </view>
  205. <view class="flex footer">
  206. <view class="cancel" @click="isShowDel=false">
  207. 取消
  208. </view>
  209. <view class="confirm" @click="delCard">
  210. 删除
  211. </view>
  212. </view>
  213. </view>
  214. </u-popup>
  215. <u-popup :show="isShowCode" @close="isShowCode=false" mode="center" :round='10'>
  216. <image style='margin:10px;height: auto;' :src="selectCode" mode="widthFix"></image>
  217. </u-popup>
  218. <u-popup :show="popupshow" :closeOnClickOverlay='true' :overlayOpacity='0.4' @close='handleHiddenShare'
  219. :round="10" mode="bottom">
  220. <view>
  221. <view class="share-content">
  222. <view class="block" @click="toUrl()">
  223. <button class="moment">
  224. <view class="iconfont icon-pengyouquan"></view>
  225. <view style="font-size: 26rpx;">分享朋友圈</view>
  226. </button>
  227. </view>
  228. <view class="block">
  229. <button class="shareBtn" type="default" data-name="shareBtn" open-type="share">
  230. <view class="iconfont icon-weixin"></view>
  231. <view style="font-size: 26rpx;">分享微信好友</view>
  232. </button>
  233. </view>
  234. </view>
  235. </view>
  236. </u-popup>
  237. <!-- 生成图片 -->
  238. <poster :data="canvasData" background-color="#FFF" :width='750' :height='420' @on-success="posterSuccess"
  239. ref="poster" @on-error="posterError"></poster>
  240. <point-share @close='showShare=false' :show='showShare'></point-share>
  241. </view>
  242. </template>
  243. <script>
  244. import Poster from '../../components/zhangyuhao-poster/Poster.vue';
  245. import PointShare from '../../components/point-share/index.vue';
  246. var that;
  247. export default {
  248. components: {
  249. Poster,
  250. PointShare
  251. },
  252. data() {
  253. return {
  254. isShowCode: false,
  255. selectCode: '',
  256. id: '',
  257. showShare: false,
  258. popupshow: false,
  259. radiovalue: 1,
  260. loading: true,
  261. isShowDel: false,
  262. cardList: [],
  263. canvasData: {},
  264. clicknum: 0,
  265. poster: ''
  266. };
  267. },
  268. onLoad() {
  269. that = this
  270. },
  271. onShow() {
  272. console.log(123123)
  273. if (uni.getLaunchOptionsSync().scene == 1154) {
  274. uni.showToast({
  275. title: '请前往小程序查看名片~',
  276. icon: 'none',
  277. duration: 10000
  278. });
  279. }
  280. this.userInfo = uni.getStorageSync("userInfo")
  281. if (uni.getStorageSync("userInfo").phone) {
  282. this.init()
  283. } else {
  284. uni.switchTab({
  285. url:'/pages/cardHolder/cardHolder'
  286. })
  287. }
  288. },
  289. onShareAppMessage(res) {
  290. console.log(res, this.popupshow)
  291. let that = this;
  292. //生成名片图片
  293. let imageUrl = this.poster
  294. console.log("imageUrl", imageUrl)
  295. if (res.from === 'button') {
  296. let path = `/pages/cardHolder/scanCodeAddCard?id=${that.currectData.id}`
  297. console.log("分享地址",path)
  298. return {
  299. title: this.popupshow ? `${that.currectData.name}分享的名片~` : '电子名片',
  300. path: path,
  301. imageUrl: this.popupshow ? imageUrl : '',
  302. };
  303. }
  304. if (res.from === 'menu') {
  305. return {
  306. title: '我的名片',
  307. path: '/pages/tabBarPro/index/index',
  308. imageUrl: this.popupshow ? imageUrl : ''
  309. };
  310. }
  311. },
  312. methods: {
  313. toUrl() {
  314. this.popupshow = false
  315. this.showShare = true
  316. },
  317. handleHiddenShare() {
  318. this.popupshow = false
  319. },
  320. posterError(err) {
  321. console.log(err)
  322. uni.hideLoading()
  323. },
  324. posterSuccess(url) {
  325. console.log("hahahah", url)
  326. // 生成成功,会把临时路径在这里返回
  327. this.poster = url;
  328. uni.hideLoading()
  329. this.popupshow = true
  330. console.log(url)
  331. },
  332. showCode(val) {
  333. this.selectCode = val.qrCodeMyself
  334. this.isShowCode = true
  335. },
  336. share(item) {
  337. uni.showLoading({
  338. title: '加载中',
  339. mask: true
  340. })
  341. this.currectData = item
  342. var data = [{
  343. type: 'image',
  344. path: this.currectData.currentBackground,
  345. use: 'bg',
  346. x: -10,
  347. y: 0,
  348. width: 530,
  349. height: 325
  350. },
  351. {
  352. type: 'image',
  353. path: this.currectData.headSculpture ? this.currectData.headSculpture :
  354. '../../static/imgs/card/defaulthead.png',
  355. shape: 'circle',
  356. use: 'head',
  357. imageType: this.currectData.headSculpture ? 'wl' : 'bd',
  358. x: 30,
  359. y: 30,
  360. width: 100,
  361. height: 100
  362. },
  363. {
  364. type: 'text',
  365. text: this.currectData.name,
  366. use: 'name',
  367. x: 150,
  368. y: 50,
  369. size: 24,
  370. color: '#000'
  371. },
  372. {
  373. type: 'text',
  374. text: this.currectData.post,
  375. use: 'post',
  376. x: 240,
  377. y: 55,
  378. size: 18,
  379. color: '#666666'
  380. },
  381. {
  382. type: 'text',
  383. text: this.currectData.companyName,
  384. use: 'companyName',
  385. x: 150,
  386. y: 95,
  387. size: 18,
  388. color: '#000'
  389. },
  390. {
  391. type: 'image',
  392. path: '../../static/imgs/card/address1.png',
  393. use: 'address-icon',
  394. x: 145,
  395. y: 130,
  396. width: 15,
  397. height: 20
  398. },
  399. {
  400. type: 'textarea',
  401. text: this.currectData.province + this.currectData.city + this.currectData.area + this
  402. .currectData.detailedAddress,
  403. lineSpace: 1,
  404. width: 320,
  405. use: 'address',
  406. x: 175,
  407. y: 135,
  408. size: 14,
  409. color: '#000'
  410. },
  411. {
  412. type: 'image',
  413. path: '../../static/imgs/card/phone1.png',
  414. use: 'phone-icon',
  415. x: 145,
  416. y: 163,
  417. width: 16,
  418. height: 16
  419. },
  420. {
  421. type: 'text',
  422. text: this.currectData.phone,
  423. use: 'phone',
  424. x: 175,
  425. y: 167,
  426. size: 14,
  427. color: '#000'
  428. },
  429. {
  430. type: 'image',
  431. path: '../../static/imgs/card/remark1.png',
  432. use: 'remark-icon',
  433. x: 145,
  434. y: 197,
  435. width: 13,
  436. height: 16
  437. },
  438. {
  439. type: 'textarea',
  440. text: this.currectData.remark ? this.currectData.remark : '单击添加备注',
  441. use: 'remark',
  442. lineSpace: 2,
  443. width: 200,
  444. x: 175,
  445. y: 200,
  446. size: 13,
  447. color: '#000'
  448. },
  449. {
  450. type: 'image',
  451. path: '../../static/imgs/card/bgc1.png',
  452. use: 'bg1',
  453. x: 3,
  454. y: 243,
  455. width: 240,
  456. height: 67
  457. },
  458. {
  459. type: 'image',
  460. path: '../../static/imgs/card/bgc2.png',
  461. use: 'bg2',
  462. x: 225,
  463. y: 243,
  464. width: 278,
  465. height: 67
  466. },
  467. {
  468. type: 'image',
  469. path: '../../static/imgs/card/home.png',
  470. use: 'home',
  471. x: 30,
  472. y: 260,
  473. width: 33,
  474. height: 33
  475. },
  476. {
  477. type: 'image',
  478. path: '../../static/imgs/card/share.png',
  479. use: 'share',
  480. x: 90,
  481. y: 263,
  482. width: 33,
  483. height: 28
  484. },
  485. {
  486. type: 'image',
  487. path: '../../static/imgs/card/ewm.png',
  488. use: 'code',
  489. x: 150,
  490. y: 263,
  491. width: 32,
  492. height: 32
  493. },
  494. {
  495. type: 'text',
  496. text: '置顶',
  497. use: 'top',
  498. x: 280,
  499. y: 265,
  500. size: 24,
  501. color: '#fff'
  502. },
  503. {
  504. type: 'text',
  505. text: '删除',
  506. use: 'del',
  507. x: 350,
  508. y: 265,
  509. size: 24,
  510. color: '#fff'
  511. },
  512. {
  513. type: 'text',
  514. text: '编辑',
  515. use: 'edit',
  516. x: 420,
  517. y: 265,
  518. size: 24,
  519. color: '#fff'
  520. },
  521. ]
  522. console.log(this.currectData.cuttentTemplate, 111111)
  523. for (var i = 0; i < data.length; i++) {
  524. switch (this.currectData.cuttentTemplate) {
  525. case '2':
  526. if (data[i].use === 'name' ||
  527. data[i].use === 'companyName' ||
  528. data[i].use === 'address-icon' ||
  529. data[i].use === 'phone-icon' ||
  530. data[i].use === 'remark-icon') {
  531. data[i].x = 30
  532. }
  533. if (data[i].use === 'address-icon') {
  534. data[i].path = '../../static/imgs/card/address3.png'
  535. }
  536. if (data[i].use === 'phone-icon') {
  537. data[i].path = '../../static/imgs/card/phone3.png'
  538. }
  539. if (data[i].use === 'remark-icon') {
  540. data[i].path = '../../static/imgs/card/remark3.png'
  541. }
  542. if (data[i].use === 'post') {
  543. data[i].x = 100
  544. }
  545. if (data[i].use === 'address' ||
  546. data[i].use === 'phone' ||
  547. data[i].use === 'remark') {
  548. data[i].x = 60
  549. }
  550. if (data[i].use == 'head') {
  551. data[i].x = 370
  552. }
  553. break;
  554. case '3':
  555. if (data[i].use === 'name') {
  556. data[i].x = 30
  557. data[i].y = 150
  558. }
  559. if (data[i].use === 'companyName') {
  560. data[i].x = 30
  561. data[i].y = 180
  562. }
  563. if (data[i].use === 'post') {
  564. data[i].x = 100
  565. data[i].y = 153
  566. }
  567. if (data[i].use === 'address-icon' ||
  568. data[i].use === 'phone-icon' ||
  569. data[i].use === 'remark-icon') {
  570. data[i].x = 170
  571. }
  572. if (data[i].use === 'address-icon') {
  573. data[i].y = 150
  574. }
  575. if (data[i].use === 'address') {
  576. data[i].y = 155;
  577. data[i].width = 300
  578. }
  579. if (data[i].use === 'phone-icon') {
  580. data[i].y = 180
  581. }
  582. if (data[i].use === 'phone') {
  583. data[i].y = 183
  584. }
  585. if (data[i].use === 'remark-icon') {
  586. data[i].y = 210
  587. }
  588. if (data[i].use === 'remark') {
  589. data[i].y = 212
  590. }
  591. if (data[i].use === 'address' ||
  592. data[i].use === 'phone' ||
  593. data[i].use === 'remark') {
  594. data[i].x = 190
  595. }
  596. break;
  597. case '4':
  598. if (data[i].use === 'name' ||
  599. data[i].use === 'companyName') {
  600. data[i].x = 30
  601. }
  602. if (data[i].use === 'companyName') {
  603. data[i].y = 90
  604. }
  605. if (data[i].use === 'post') {
  606. data[i].x = 100
  607. }
  608. if (data[i].use == 'head') {
  609. data[i].x = 25
  610. data[i].y = 120
  611. }
  612. if (data[i].use === 'address-icon') {
  613. data[i].path = '../../static/imgs/card/address2.png'
  614. }
  615. if (data[i].use === 'phone-icon') {
  616. data[i].path = '../../static/imgs/card/phone2.png'
  617. }
  618. if (data[i].use === 'remark-icon') {
  619. data[i].path = '../../static/imgs/card/remark2.png'
  620. }
  621. if (data[i].use === 'address-icon' ||
  622. data[i].use === 'phone-icon' ||
  623. data[i].use === 'remark-icon') {
  624. data[i].x = 170
  625. }
  626. if (data[i].use === 'address') {
  627. data[i].width = 300
  628. }
  629. if (data[i].use === 'address' ||
  630. data[i].use === 'phone' ||
  631. data[i].use === 'remark') {
  632. data[i].x = 190
  633. }
  634. break;
  635. default:
  636. }
  637. }
  638. this.canvasData = {
  639. clicknum: this.clicknum++,
  640. list: data,
  641. page: 'myInfo'
  642. }
  643. console.log(1111111)
  644. },
  645. toHome(item) {
  646. uni.navigateTo({
  647. url: "/pages/mySet/myHome?id=" + item.personalHomeId
  648. })
  649. },
  650. radioChange(n) {
  651. console.log('radioChange', n);
  652. },
  653. init() {
  654. var that = this
  655. this.$request.baseRequest('admin.unimall.cardManagementInfo', 'list', {
  656. commonId: this.userInfo.id
  657. }, failres => {
  658. uni.hideLoading()
  659. uni.showToast({
  660. icon: "none",
  661. title: failres.errmsg,
  662. duration: 3000
  663. });
  664. }).then(res => {
  665. this.cardList = res.data.items
  666. setTimeout(() => {
  667. that.loading = false
  668. }, 1500)
  669. })
  670. },
  671. toEditCard(val) {
  672. uni.navigateTo({
  673. url: "/pages/mySet/editCard?itemVal=" + JSON.stringify(val)
  674. })
  675. },
  676. delCard() {
  677. let _data = {}
  678. if (this.radiovalue == 1) {
  679. _data = {
  680. id: this.id
  681. }
  682. } else {
  683. _data = {
  684. id: this.id,
  685. deleteCondition: 1
  686. }
  687. }
  688. that.$request.baseRequest('admin.unimall.cardManagementInfo', 'delete', _data, failres => {
  689. uni.hideLoading()
  690. uni.showToast({
  691. icon: "none",
  692. title: failres.errmsg,
  693. duration: 3000
  694. });
  695. }).then(res => {
  696. this.isShowDel = false
  697. uni.showToast({
  698. icon: "success",
  699. title: '删除成功!',
  700. duration: 2000
  701. });
  702. this.init()
  703. })
  704. },
  705. del(val) {
  706. this.id = val
  707. this.isShowDel = true
  708. },
  709. addCard() {
  710. uni.navigateTo({
  711. url: "/pages/mySet/newCard?cardIndex=" + (this.cardList.length + 1)
  712. })
  713. },
  714. topMarking(val) {
  715. that.$request.baseRequest('admin.unimall.cardManagementInfo', 'top', {
  716. cardManagementInfo: JSON.stringify({
  717. id: val.id
  718. })
  719. }, failres => {
  720. uni.hideLoading()
  721. uni.showToast({
  722. icon: "none",
  723. title: failres.errmsg,
  724. duration: 3000
  725. });
  726. }).then(res => {
  727. uni.showToast({
  728. icon: "success",
  729. title: '置顶成功!',
  730. duration: 2000
  731. })
  732. this.init()
  733. })
  734. }
  735. }
  736. }
  737. </script>
  738. <style lang="scss" scoped>
  739. .content {
  740. padding-bottom: 40rpx;
  741. }
  742. .card-content {
  743. width: 100%;
  744. }
  745. .content1 {
  746. .icon-text {
  747. margin-left: 10rpx;
  748. }
  749. .style1 {
  750. display: flex;
  751. margin-bottom: 70rpx;
  752. padding: 30rpx;
  753. box-sizing: border-box;
  754. .left {
  755. width: 132rpx;
  756. height: 132rpx;
  757. border-radius: 50%;
  758. }
  759. .right {
  760. margin-left: 40rpx;
  761. .row1 {
  762. .name {
  763. font-size: 38rpx;
  764. font-weight: bold;
  765. color: #040000;
  766. margin-right: 20rpx;
  767. }
  768. .post {
  769. font-size: 26rpx;
  770. font-weight: 500;
  771. color: #666666;
  772. }
  773. }
  774. .row2 {
  775. margin-top: 20rpx;
  776. font-size: 24rpx;
  777. font-weight: bold;
  778. color: #323333;
  779. }
  780. .row3,
  781. .row4 {
  782. margin-top: 30rpx;
  783. font-size: 24rpx;
  784. font-weight: 500;
  785. color: #323333;
  786. }
  787. }
  788. }
  789. .style2 {
  790. padding: 30rpx;
  791. box-sizing: border-box;
  792. margin-bottom: 70rpx;
  793. .top {
  794. .row1 {
  795. .name {
  796. font-size: 38rpx;
  797. font-weight: bold;
  798. color: #040000;
  799. margin-right: 20rpx;
  800. }
  801. .post {
  802. font-size: 26rpx;
  803. font-weight: 500;
  804. color: #666666;
  805. }
  806. }
  807. .row2 {
  808. margin-top: 20rpx;
  809. font-size: 24rpx;
  810. font-weight: bold;
  811. color: #323333;
  812. }
  813. }
  814. .bottom {
  815. margin-top: 20rpx;
  816. .left {
  817. margin-right: 40rpx;
  818. .row1 {
  819. .name {
  820. font-size: 38rpx;
  821. font-weight: bold;
  822. color: #040000;
  823. margin-right: 20rpx;
  824. }
  825. .post {
  826. font-size: 26rpx;
  827. font-weight: 500;
  828. color: #666666;
  829. }
  830. }
  831. .row2 {
  832. margin-top: 20rpx;
  833. font-size: 24rpx;
  834. font-weight: bold;
  835. color: #323333;
  836. }
  837. }
  838. .right {
  839. .row1,
  840. .row2 {
  841. font-size: 24rpx;
  842. font-weight: 500;
  843. color: #323333;
  844. }
  845. .row2 {
  846. margin-top: 20rpx;
  847. }
  848. .row3,
  849. .row4 {
  850. margin-top: 30rpx;
  851. font-size: 24rpx;
  852. font-weight: 500;
  853. color: #323333;
  854. }
  855. }
  856. }
  857. }
  858. }
  859. .card-list {
  860. padding: 0 20rpx;
  861. .title-name {
  862. font-weight: bold;
  863. color: #19191A;
  864. margin: 20rpx 0;
  865. }
  866. }
  867. .card-list-item {
  868. width: calc(100% + 40rpx);
  869. left: -20rpx;
  870. position: relative;
  871. border-radius: 30rpx;
  872. padding: 40rpx;
  873. box-sizing: border-box;
  874. .car-bottom {
  875. position: absolute;
  876. bottom: 22rpx;
  877. left: 20rpx;
  878. width: calc(100% - 40rpx);
  879. .left {
  880. position: absolute;
  881. padding: 20rpx 0;
  882. width: 305rpx;
  883. box-sizing: border-box;
  884. display: flex;
  885. justify-content: space-evenly;
  886. background: url("../../static/imgs/card/bgc1.png") no-repeat center;
  887. background-size: 100% 100%;
  888. }
  889. .right {
  890. font-size: 25rpx;
  891. padding: 20rpx 0;
  892. position: relative;
  893. right: -278rpx;
  894. width: calc(100vw - 320rpx);
  895. box-sizing: border-box;
  896. display: flex;
  897. justify-content: space-evenly;
  898. background: url("../../static/imgs/card/bgc2.png") no-repeat center;
  899. background-size: 100% 100%;
  900. .text {
  901. color: #fff;
  902. }
  903. }
  904. }
  905. .left {
  906. width: 30%;
  907. .top {
  908. margin-bottom: 20rpx;
  909. }
  910. .img {
  911. width: 80%;
  912. }
  913. .bottom {}
  914. }
  915. .right {
  916. .row1 {
  917. .line {
  918. width: 1px;
  919. height: 20px;
  920. margin: 0 20rpx;
  921. background: black;
  922. }
  923. }
  924. }
  925. }
  926. .upload {
  927. background-color: #fff;
  928. margin: 20rpx;
  929. border-radius: 20rpx;
  930. padding: 76rpx;
  931. .solids {
  932. flex-direction: column;
  933. .text {
  934. margin-top: 20rpx;
  935. font-size: 26rpx;
  936. font-weight: 500;
  937. color: #666666;
  938. }
  939. }
  940. }
  941. .share-content {
  942. display: flex;
  943. padding: 20rpx;
  944. justify-content: center;
  945. font-size: 24rpx;
  946. button {
  947. background: transparent;
  948. line-height: 1.5;
  949. }
  950. button:after {
  951. border: none;
  952. }
  953. }
  954. .icon-pengyouquan,
  955. .icon-weixin {
  956. font-size: 50px;
  957. color: #33CC00;
  958. }
  959. .del-style {
  960. padding: 40rpx 40rpx 160rpx 40rpx;
  961. font-size: 32rpx;
  962. position: relative;
  963. .title {
  964. color: #1A1A1A;
  965. font-size: 32rpx;
  966. font-weight: bold;
  967. }
  968. .radio-wrap {
  969. padding: 23rpx;
  970. border-radius: 10rpx;
  971. background: #F5F5F5;
  972. margin: 20rpx 0;
  973. }
  974. .cancel,
  975. .confirm {
  976. width: 50%;
  977. text-align: center;
  978. padding: 35rpx 0;
  979. border-top: 1px solid #ccc;
  980. font-size: 36rpx;
  981. }
  982. .footer {
  983. position: absolute;
  984. bottom: 0px;
  985. width: 100%;
  986. left: 0;
  987. }
  988. .cancel {
  989. border-right: 1px solid #ccc;
  990. }
  991. .confirm {
  992. color: #4977FC;
  993. }
  994. }
  995. </style>