myInfo.vue 13 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481
  1. <template>
  2. <view class="content">
  3. <view class="card-list content1">
  4. <view class="row" v-for="(item,index) in cardList" :key="index">
  5. <view class="title-name">
  6. {{item.cardBusiness}}
  7. </view>
  8. <view class="card-list-item" :style="item.currentBackground?'background:url('+item.currentBackground+');background-size:100% 100%':''">
  9. <view class="card-content style1" v-if="item.cuttentTemplate==1">
  10. <view class="left">
  11. <u--image :showLoading="true" :src="item.headSculpture" width="66px" height="66px" shape="circle"></u--image>
  12. </view>
  13. <view class="right">
  14. <view class="row1">
  15. <text class="name">{{item.name}}</text>
  16. <text class="post">{{item.post}}</text>
  17. </view>
  18. <view class="row2">
  19. {{item.companyName}}
  20. </view>
  21. <view class="row3 flex">
  22. <uni-icons type="map-filled" size="20" style="margin-right: 20rpx;" color="#5e6d82"></uni-icons>{{ item.province }}{{ item.city }}{{ item.area }}
  23. </view>
  24. <view class="row4 flex">
  25. <uni-icons type="phone-filled" size="20" style="margin-right: 20rpx;" color="#5e6d82"></uni-icons>{{ item.phone }}
  26. </view>
  27. <!-- <view class="">
  28. 备注
  29. </view> -->
  30. </view>
  31. </view>
  32. <view class="card-content style1 flex-between" v-if="item.cuttentTemplate==2">
  33. <view class="right">
  34. <view class="row1">
  35. <text class="name">{{item.name}}</text>
  36. <text class="post">{{item.post}}</text>
  37. </view>
  38. <view class="row2">
  39. {{item.companyName}}
  40. </view>
  41. <view class="row3 flex">
  42. <uni-icons type="map-filled" size="20" style="margin-right: 20rpx;" color="#5e6d82"></uni-icons>{{ item.province }}{{ item.city }}{{ item.area }}
  43. </view>
  44. <view class="row4 flex">
  45. <uni-icons type="phone-filled" size="20" style="margin-right: 20rpx;" color="#5e6d82"></uni-icons>{{ item.phone }}
  46. </view>
  47. <!-- <view class="">
  48. 备注
  49. </view> -->
  50. </view>
  51. <view class="left">
  52. <u--image :showLoading="true" :src="item.headSculpture" width="66px" height="66px" shape="circle" v-if="item.headSculpture"></u--image>
  53. <u--image :showLoading="true" src="/./../static/imgs/card/defaulthead.png" width="66px" height="66px" shape="circle" v-else></u--image>
  54. </view>
  55. </view>
  56. <view class="card-content style2" v-if="item.cuttentTemplate==3">
  57. <view class="top">
  58. <u--image :showLoading="true" :src="item.headSculpture" width="66px" height="66px" shape="circle" v-if="item.headSculpture"></u--image>
  59. <u--image :showLoading="true" src="/./../static/imgs/card/defaulthead.png" width="66px" height="66px" shape="circle" v-else></u--image>
  60. </view>
  61. <view class="bottom flex">
  62. <view class="left">
  63. <view class="row1">
  64. <text class="name">{{item.name}}</text>
  65. <text class="post">{{item.post}}</text>
  66. </view>
  67. <view class="row2">
  68. {{item.companyName}}
  69. </view>
  70. </view>
  71. <view class="right">
  72. <view class="row1 flex">
  73. <uni-icons type="map-filled" size="20" style="margin-right: 20rpx;" color="#5e6d82"></uni-icons>{{ item.province }}{{ item.city }}{{ item.area }}
  74. </view>
  75. <view class="row2 flex">
  76. <uni-icons type="phone-filled" size="20" style="margin-right: 20rpx;" color="#5e6d82"></uni-icons>{{ item.phone }}
  77. </view>
  78. </view>
  79. </view>
  80. </view>
  81. <view class="card-content style2" v-if="item.cuttentTemplate==4">
  82. <view class="top">
  83. <view class="row1">
  84. <text class="name">{{item.name}}</text>
  85. <text class="post">{{item.post}}</text>
  86. </view>
  87. <view class="row2">
  88. {{item.companyName}}
  89. </view>
  90. </view>
  91. <view class="bottom flex">
  92. <view class="left">
  93. <u--image :showLoading="true" :src="item.headSculpture" width="66px" height="66px" shape="circle" v-if="item.headSculpture"></u--image>
  94. <u--image :showLoading="true" src="/./../static/imgs/card/defaulthead.png" width="66px" height="66px" shape="circle" v-else></u--image>
  95. </view>
  96. <view class="right">
  97. <view class="row1 flex">
  98. <uni-icons type="map-filled" size="20" style="margin-right: 20rpx;" color="#5e6d82"></uni-icons>{{ item.province }}{{ item.city }}{{ item.area }}
  99. </view>
  100. <view class="row2 flex">
  101. <uni-icons type="phone-filled" size="20" style="margin-right: 20rpx;" color="#5e6d82"></uni-icons>{{ item.phone }}
  102. </view>
  103. </view>
  104. </view>
  105. </view>
  106. <view class="car-bottom flex">
  107. <view class="left">
  108. <image src="../../static/imgs/card/home.png" mode="widthFix" style="width: 32rpx;" @click="toHome(item)"></image>
  109. <image src="../../static/imgs/card/share.png" mode="widthFix" style="width: 35rpx;" @click="share(item)"></image>
  110. <image src="../../static/imgs/card/ewm.png" mode="widthFix" style="width: 32rpx;" @click="showCode(item)"></image>
  111. </view>
  112. <view class="right">
  113. <text class="text" @click="topMarking(item)">置顶</text>
  114. <text class="text" @click="del(item.id)">删除</text>
  115. <text class="text" @click="toEditCard(item)">编辑</text>
  116. </view>
  117. <!-- <u-button text="置顶" @click="topMarking(item)" throttle-time='1000'></u-button> -->
  118. <!-- <button @click="$u.debounce(topMarking, 500)">置顶</button> -->
  119. <!-- <button @click="$u.debounce(topMarking(item), 500)">置顶</button> -->
  120. <!-- <u-button text="删除" @click="del(item.id)" throttle-time='1000'></u-button> -->
  121. <!-- <button @click="toEditCard(item)">编辑</button> -->
  122. </view>
  123. </view>
  124. </view>
  125. </view>
  126. <view class="upload flex flex-all-center" @click="addCard">
  127. <view class="solids flex flex-all-center">
  128. <image src="../../static/imgs/card/add.png" mode="widthFix" style="width: 148rpx;"></image>
  129. <text class='text'>添加新名片</text>
  130. </view>
  131. </view>
  132. <u-toast ref="uToast"></u-toast>
  133. <u-popup :show="isShowDel" @close="isShowDel=false" mode="center">
  134. <view class="del-style">
  135. <text class="title">删除名片自动退出关联得圈子,确定删除?</text>
  136. <u-radio-group v-model="radiovalue" placement="column">
  137. <u-radio :customStyle="{marginBottom: '8px'}" v-for="(item, index) in radiolist" :key="index"
  138. :label="item.name" :name="item.name" @change="radioChange">
  139. </u-radio>
  140. </u-radio-group>
  141. <view class="flex">
  142. <view class="" @click="isShowDel=false">
  143. 取消
  144. </view>
  145. <view class="" @click="delCard">
  146. 删除
  147. </view>
  148. </view>
  149. </view>
  150. </u-popup>
  151. <u-popup :show="isShowCode" @close="isShowCode=false" mode="center" :round='10'>
  152. <image style='margin:10px;' :src="selectCode" mode="widthFix"></image>
  153. </u-popup>
  154. </view>
  155. </template>
  156. <script>
  157. var that;
  158. export default {
  159. data() {
  160. return {
  161. isShowCode:false,
  162. selectCode:'',
  163. id: '',
  164. radiovalue: '仅从自己名片列表删除',
  165. radiolist: [{
  166. name: '仅从自己名片列表删除',
  167. disabled: false
  168. },
  169. {
  170. name: '从所有拥有此名片用户列表删除',
  171. disabled: false
  172. }
  173. ],
  174. isShowDel: false,
  175. cardList: []
  176. };
  177. },
  178. onLoad() {
  179. that = this
  180. this.userInfo = uni.getStorageSync("userInfo")
  181. },
  182. onShow() {
  183. this.init()
  184. },
  185. methods: {
  186. showCode(val){
  187. this.selectCode = val.qrCodeMyself
  188. this.isShowCode = true
  189. },
  190. share(){
  191. },
  192. toHome(item){
  193. uni.navigateTo({
  194. url: "/pages/mySet/myHome?id="+item.personalHomeId
  195. })
  196. },
  197. radioChange(n) {
  198. console.log('radioChange', n);
  199. },
  200. init() {
  201. this.$request.baseRequest('admin.unimall.cardManagementInfo', 'list', {
  202. commonId: this.userInfo.id
  203. }, failres => {
  204. this.$refs.uToast.show({
  205. type: 'error',
  206. message: failres.errmsg,
  207. })
  208. uni.hideLoading()
  209. }).then(res => {
  210. this.cardList = res.data.items
  211. })
  212. },
  213. toEditCard(val) {
  214. uni.navigateTo({
  215. url: "/pages/mySet/editCard?itemVal="+JSON.stringify(val)
  216. })
  217. },
  218. delCard() {
  219. let _data = {}
  220. if (this.radiovalue == '仅从自己名片列表删除') {
  221. _data = {
  222. id: this.id
  223. }
  224. } else {
  225. _data = {
  226. id: this.id,
  227. deleteCondition: 1
  228. }
  229. }
  230. that.$request.baseRequest('admin.unimall.cardManagementInfo', 'delete', _data, failres => {
  231. this.$refs.uToast.show({
  232. type: 'error',
  233. message: failres.errmsg,
  234. })
  235. uni.hideLoading()
  236. }).then(res => {
  237. this.isShowDel = false
  238. this.$refs.uToast.show({
  239. type: 'success',
  240. message: '删除成功!',
  241. })
  242. this.init()
  243. })
  244. },
  245. del(val) {
  246. this.id = val
  247. this.isShowDel = true
  248. },
  249. addCard() {
  250. uni.navigateTo({
  251. url: "/pages/mySet/newCard"
  252. })
  253. },
  254. topMarking(val) {
  255. that.$request.baseRequest('admin.unimall.cardManagementInfo', 'top', {
  256. cardManagementInfo: JSON.stringify({
  257. id: val.id
  258. })
  259. }, failres => {
  260. this.$refs.uToast.show({
  261. type: 'error',
  262. message: failres.errmsg,
  263. })
  264. uni.hideLoading()
  265. }).then(res => {
  266. this.$refs.uToast.show({
  267. type: 'success',
  268. message: '置顶成功!',
  269. })
  270. this.init()
  271. })
  272. }
  273. }
  274. }
  275. </script>
  276. <style lang="scss" scoped>
  277. .content{
  278. padding-bottom: 40rpx;
  279. }
  280. .card-content{
  281. width: 100%;
  282. }
  283. .content1{
  284. .style1{
  285. display: flex;
  286. padding: 20rpx 30rpx;
  287. width: 85%;
  288. margin-bottom: 90rpx;
  289. .left{
  290. width: 132rpx;
  291. height: 132rpx;
  292. border-radius: 50%;
  293. }
  294. .right{
  295. margin-left: 40rpx;
  296. .row1{
  297. .name{
  298. font-size: 38rpx;
  299. font-weight: bold;
  300. color: #040000;
  301. margin-right: 20rpx;
  302. }
  303. .post{
  304. font-size: 26rpx;
  305. font-weight: 500;
  306. color: #666666;
  307. }
  308. }
  309. .row2{
  310. margin-top: 20rpx;
  311. font-size: 24rpx;
  312. font-weight: bold;
  313. color: #323333;
  314. }
  315. .row3{
  316. margin-top: 30rpx;
  317. font-size: 24rpx;
  318. font-weight: 500;
  319. color: #323333;
  320. }
  321. }
  322. }
  323. .style2{
  324. padding:30rpx;
  325. margin-bottom: 100rpx;
  326. .top{
  327. .row1{
  328. .name{
  329. font-size: 38rpx;
  330. font-weight: bold;
  331. color: #040000;
  332. margin-right: 20rpx;
  333. }
  334. .post{
  335. font-size: 26rpx;
  336. font-weight: 500;
  337. color: #666666;
  338. }
  339. }
  340. .row2{
  341. margin-top: 20rpx;
  342. font-size: 24rpx;
  343. font-weight: bold;
  344. color: #323333;
  345. }
  346. }
  347. .bottom{
  348. margin-top: 48rpx;
  349. .left{
  350. margin-right: 40rpx;
  351. .row1{
  352. .name{
  353. font-size: 38rpx;
  354. font-weight: bold;
  355. color: #040000;
  356. margin-right: 20rpx;
  357. }
  358. .post{
  359. font-size: 26rpx;
  360. font-weight: 500;
  361. color: #666666;
  362. }
  363. }
  364. .row2{
  365. margin-top: 20rpx;
  366. font-size: 24rpx;
  367. font-weight: bold;
  368. color: #323333;
  369. }
  370. }
  371. .right{
  372. .row1,.row2{
  373. font-size: 24rpx;
  374. font-weight: 500;
  375. color: #323333;
  376. }
  377. .row2{
  378. margin-top: 20rpx;
  379. }
  380. }
  381. }
  382. }
  383. }
  384. .card-list{
  385. padding:0 20rpx;
  386. .title-name{
  387. font-weight: bold;
  388. color: #19191A;
  389. margin: 20rpx 0;
  390. }
  391. }
  392. .card-list-item {
  393. width: calc(100% + 40rpx);
  394. left:-20rpx;
  395. position: relative;
  396. border-radius: 30rpx;
  397. padding: 40rpx;
  398. box-sizing: border-box;
  399. .car-bottom{
  400. position: absolute;
  401. bottom: 20rpx;
  402. left:20rpx;
  403. width: calc(100% - 40rpx);
  404. .left{
  405. position: absolute;
  406. padding: 20rpx 0;
  407. width: 310rpx;
  408. box-sizing: border-box;
  409. display: flex;
  410. justify-content: space-evenly;
  411. background: url("../../static/imgs/card/bgc1.png") no-repeat center;
  412. background-size: 100% 100%;
  413. }
  414. .right{
  415. font-size: 26rpx;
  416. padding: 20rpx 0;
  417. position: relative;
  418. right: -280rpx;
  419. width: calc(100vw - 320rpx);
  420. box-sizing: border-box;
  421. display: flex;
  422. justify-content: space-evenly;
  423. background: url("../../static/imgs/card/bgc2.png") no-repeat center;
  424. background-size: 100% 100%;
  425. .text{
  426. color: #fff;
  427. }
  428. }
  429. }
  430. .left {
  431. width: 30%;
  432. .top {
  433. margin-bottom: 20rpx;
  434. }
  435. .img {
  436. width: 80%;
  437. }
  438. .bottom {}
  439. }
  440. .right {
  441. .row1 {
  442. .line {
  443. width: 1px;
  444. height: 20px;
  445. margin: 0 20rpx;
  446. background: black;
  447. }
  448. }
  449. }
  450. }
  451. .upload{
  452. background-color: #fff;
  453. margin: 20rpx;
  454. border-radius: 20rpx;
  455. padding: 76rpx;
  456. .solids{
  457. flex-direction: column;
  458. .text{
  459. margin-top: 20rpx;
  460. font-size: 26rpx;
  461. font-weight: 500;
  462. color: #666666;
  463. }
  464. }
  465. }
  466. </style>