myInfo.vue 12 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475
  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="'background:url('+item.currentBackground+');background-size:100% 100%'">
  9. <view class="card-content style1" v-if="item.cuttentTemplate==0">
  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==1">
  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==2">
  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==3">
  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. </view>
  152. </template>
  153. <script>
  154. var that;
  155. export default {
  156. data() {
  157. return {
  158. id: '',
  159. radiovalue: '仅从自己名片列表删除',
  160. radiolist: [{
  161. name: '仅从自己名片列表删除',
  162. disabled: false
  163. },
  164. {
  165. name: '从所有拥有此名片用户列表删除',
  166. disabled: false
  167. }
  168. ],
  169. isShowDel: false,
  170. cardList: []
  171. };
  172. },
  173. onLoad() {
  174. that = this
  175. this.userInfo = uni.getStorageSync("userInfo")
  176. },
  177. onShow() {
  178. this.init()
  179. },
  180. methods: {
  181. showCode(val){
  182. },
  183. share(){
  184. },
  185. toHome(item){
  186. uni.navigateTo({
  187. url: "/pages/mySet/myHome?id="+item.personalHomeId
  188. })
  189. },
  190. radioChange(n) {
  191. console.log('radioChange', n);
  192. },
  193. init() {
  194. this.$request.baseRequest('admin.unimall.cardManagementInfo', 'list', {
  195. commonId: this.userInfo.id
  196. }, failres => {
  197. this.$refs.uToast.show({
  198. type: 'error',
  199. message: failres.errmsg,
  200. })
  201. uni.hideLoading()
  202. }).then(res => {
  203. this.cardList = res.data.items
  204. })
  205. },
  206. toEditCard(val) {
  207. uni.navigateTo({
  208. url: "/pages/mySet/editCard?itemVal="+JSON.stringify(val)
  209. })
  210. },
  211. delCard() {
  212. let _data = {}
  213. if (this.radiovalue == '仅从自己名片列表删除') {
  214. _data = {
  215. id: this.id
  216. }
  217. } else {
  218. _data = {
  219. id: this.id,
  220. deleteCondition: 1
  221. }
  222. }
  223. that.$request.baseRequest('admin.unimall.cardManagementInfo', 'delete', _data, failres => {
  224. this.$refs.uToast.show({
  225. type: 'error',
  226. message: failres.errmsg,
  227. })
  228. uni.hideLoading()
  229. }).then(res => {
  230. this.isShowDel = false
  231. this.$refs.uToast.show({
  232. type: 'success',
  233. message: '删除成功!',
  234. })
  235. this.init()
  236. })
  237. },
  238. del(val) {
  239. this.id = val
  240. this.isShowDel = true
  241. },
  242. addCard() {
  243. uni.navigateTo({
  244. url: "/pages/mySet/newCard"
  245. })
  246. },
  247. topMarking(val) {
  248. that.$request.baseRequest('admin.unimall.cardManagementInfo', 'top', {
  249. cardManagementInfo: JSON.stringify({
  250. id: val.id
  251. })
  252. }, failres => {
  253. this.$refs.uToast.show({
  254. type: 'error',
  255. message: failres.errmsg,
  256. })
  257. uni.hideLoading()
  258. }).then(res => {
  259. this.$refs.uToast.show({
  260. type: 'success',
  261. message: '置顶成功!',
  262. })
  263. this.init()
  264. })
  265. }
  266. }
  267. }
  268. </script>
  269. <style lang="scss" scoped>
  270. .content{
  271. padding-bottom: 40rpx;
  272. }
  273. .card-content{
  274. width: 100%;
  275. }
  276. .content1{
  277. .style1{
  278. display: flex;
  279. padding: 20rpx 30rpx;
  280. width: 85%;
  281. margin-bottom: 90rpx;
  282. .left{
  283. width: 132rpx;
  284. height: 132rpx;
  285. border-radius: 50%;
  286. }
  287. .right{
  288. margin-left: 40rpx;
  289. .row1{
  290. .name{
  291. font-size: 38rpx;
  292. font-weight: bold;
  293. color: #040000;
  294. margin-right: 20rpx;
  295. }
  296. .post{
  297. font-size: 26rpx;
  298. font-weight: 500;
  299. color: #666666;
  300. }
  301. }
  302. .row2{
  303. margin-top: 20rpx;
  304. font-size: 24rpx;
  305. font-weight: bold;
  306. color: #323333;
  307. }
  308. .row3{
  309. margin-top: 30rpx;
  310. font-size: 24rpx;
  311. font-weight: 500;
  312. color: #323333;
  313. }
  314. }
  315. }
  316. .style2{
  317. padding:30rpx;
  318. margin-bottom: 100rpx;
  319. .top{
  320. .row1{
  321. .name{
  322. font-size: 38rpx;
  323. font-weight: bold;
  324. color: #040000;
  325. margin-right: 20rpx;
  326. }
  327. .post{
  328. font-size: 26rpx;
  329. font-weight: 500;
  330. color: #666666;
  331. }
  332. }
  333. .row2{
  334. margin-top: 20rpx;
  335. font-size: 24rpx;
  336. font-weight: bold;
  337. color: #323333;
  338. }
  339. }
  340. .bottom{
  341. margin-top: 48rpx;
  342. .left{
  343. margin-right: 40rpx;
  344. .row1{
  345. .name{
  346. font-size: 38rpx;
  347. font-weight: bold;
  348. color: #040000;
  349. margin-right: 20rpx;
  350. }
  351. .post{
  352. font-size: 26rpx;
  353. font-weight: 500;
  354. color: #666666;
  355. }
  356. }
  357. .row2{
  358. margin-top: 20rpx;
  359. font-size: 24rpx;
  360. font-weight: bold;
  361. color: #323333;
  362. }
  363. }
  364. .right{
  365. .row1,.row2{
  366. font-size: 24rpx;
  367. font-weight: 500;
  368. color: #323333;
  369. }
  370. .row2{
  371. margin-top: 20rpx;
  372. }
  373. }
  374. }
  375. }
  376. }
  377. .card-list{
  378. padding:0 20rpx;
  379. .title-name{
  380. font-weight: bold;
  381. color: #19191A;
  382. margin: 20rpx 0;
  383. }
  384. }
  385. .card-list-item {
  386. width: calc(100% + 40rpx);
  387. left:-20rpx;
  388. position: relative;
  389. border-radius: 30rpx;
  390. padding: 40rpx;
  391. box-sizing: border-box;
  392. .car-bottom{
  393. position: absolute;
  394. bottom: 20rpx;
  395. left:20rpx;
  396. width: calc(100% - 40rpx);
  397. .left{
  398. position: absolute;
  399. padding: 20rpx 0;
  400. width: 310rpx;
  401. box-sizing: border-box;
  402. display: flex;
  403. justify-content: space-evenly;
  404. background: url("../../static/imgs/card/bgc1.png") no-repeat center;
  405. background-size: 100% 100%;
  406. }
  407. .right{
  408. font-size: 26rpx;
  409. padding: 20rpx 0;
  410. position: relative;
  411. right: -280rpx;
  412. width: calc(100vw - 320rpx);
  413. box-sizing: border-box;
  414. display: flex;
  415. justify-content: space-evenly;
  416. background: url("../../static/imgs/card/bgc2.png") no-repeat center;
  417. background-size: 100% 100%;
  418. .text{
  419. color: #fff;
  420. }
  421. }
  422. }
  423. .left {
  424. width: 30%;
  425. .top {
  426. margin-bottom: 20rpx;
  427. }
  428. .img {
  429. width: 80%;
  430. }
  431. .bottom {}
  432. }
  433. .right {
  434. .row1 {
  435. .line {
  436. width: 1px;
  437. height: 20px;
  438. margin: 0 20rpx;
  439. background: black;
  440. }
  441. }
  442. }
  443. }
  444. .upload{
  445. background-color: #fff;
  446. margin: 20rpx;
  447. border-radius: 20rpx;
  448. padding: 76rpx;
  449. .solids{
  450. flex-direction: column;
  451. .text{
  452. margin-top: 20rpx;
  453. font-size: 26rpx;
  454. font-weight: 500;
  455. color: #666666;
  456. }
  457. }
  458. }
  459. </style>