cardHolder.vue 45 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681168216831684168516861687168816891690169116921693169416951696169716981699170017011702170317041705170617071708170917101711171217131714
  1. <template>
  2. <view class="content">
  3. <view class='wrap'>
  4. <u-navbar title="电子名片" placeholder bgColor="#112253" titleStyle="color:#fff">
  5. <view class="u-nav-slot relative" slot="left">
  6. <u-icon name="bell" size="26" @click="toNotice" color="#fff"></u-icon>
  7. <u-badge :isDot="unread>0?true:false" type="error" class="point"></u-badge>
  8. </view>
  9. </u-navbar>
  10. <view class="content1 flex-row-center">
  11. <view class="search flex justify-space-between align-item-center flex-between" @click="search">
  12. <view class="left flex">
  13. <uni-icons type="search" size="24" color="#9199af"></uni-icons>
  14. <text class="search-val"> {{searchVal?searchVal:'搜索名片'}}</text>
  15. </view>
  16. <view class="right">
  17. <image style='width:32rpx;height:32rpx;' v-if="searchVal" @click.native.stop="delSearchVal"
  18. src="../../static/imgs/card/searchdel.png" mode="widthFix"></image>
  19. <uni-icons type="mic" size="24" @click.native.stop="micOpen" color="#9199af" style="margin-left: 20rpx;"></uni-icons>
  20. </view>
  21. </view>
  22. <view class="col flex">
  23. <uni-icons type="scan" size="30" @click="scan" color="#fff"></uni-icons>
  24. </view>
  25. </view>
  26. <view
  27. :style='cardHolderList.length>0?"padding:20rpx 20rpx 200rpx 20rpx;":"padding:20rpx 20rpx 20rpx 20rpx;"'
  28. class="content2" v-if="cardHolderList.length>0">
  29. <view class="all-type flex" @click="selectType">
  30. <text style="margin-right: 10rpx;">{{typeName?typeName:'全部分类'}}</text>
  31. <uni-icons type="bottom" size="18" color="#fff"></uni-icons>
  32. </view>
  33. </view>
  34. </view>
  35. <!-- :style='cardHolderList.length>0?"top:376rpx;":"top:276rpx;"' -->
  36. <view class="content3 relative" style="top: 380rpx;">
  37. <mescroll-uni v-if='cardHolderList' :up="upOption" :down="downOption" ref="mescrollRef" @init="mescrollInit"
  38. @up="upCallback" @down="downCallback" height="1060">
  39. <view v-for='(item,index) in cardHolderList' @longpress="longpress" class="item flex">
  40. <!-- <view class="card-list-item" style="background:red"> -->
  41. <view class="card-list-item"
  42. :style="'background: url('+item.currentBackground+');background-size:100% 100%'">
  43. <view class="card-content style1" v-if="item.cuttentTemplate==1">
  44. <view class="left">
  45. <u--image :showLoading="true" :src="item.headSculpture" width="66px" height="66px"
  46. shape="circle"></u--image>
  47. </view>
  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" @click="toMap(item)">
  57. <u--image :showLoading="true" :src="'/static/imgs/card/address'+item.icon+'.png'" width="13px"
  58. height="16px"></u--image>
  59. <view class='icon-text'>{{ item.province }}{{ item.city }}{{ item.area }}</view>
  60. </view>
  61. <view @click="freeTell(item)" class="row4 flex">
  62. <u--image :showLoading="true" :src="'/static/imgs/card/phone'+item.icon+'.png'" width="12px"
  63. height="13px"></u--image>
  64. <view class='icon-text'>{{ item.phone }}</view>
  65. </view>
  66. <view @click='remarkEdit(item)' class="row2 flex" style="color: #808080">
  67. <u--image :showLoading="true" :src="'/static/imgs/card/remark'+item.icon+'.png'" width="10px"
  68. height="12px"></u--image>
  69. <view class='icon-text' style="color: #808080;">{{item.remark?item.remark:'单击添加备注'}}
  70. </view>
  71. </view>
  72. </view>
  73. <u-checkbox-group v-if='islongPress' placement="column"
  74. @change="checkboxChange($event,index)">
  75. <u-checkbox iconColor='#4977FC' activeColor="#fff" :name='index+1'
  76. :checked='item.checked' :customStyle="{marginBottom: '8px'}">
  77. </u-checkbox>
  78. </u-checkbox-group>
  79. </view>
  80. <view class="card-content style1 flex-between" v-if="item.cuttentTemplate==2">
  81. <view class="right">
  82. <view class="row1">
  83. <text class="name">{{item.name}}</text>
  84. <text class="post">{{item.post}}</text>
  85. </view>
  86. <view class="row2">
  87. {{item.companyName}}
  88. </view>
  89. <view @click="toMap(item)" class="row3 flex">
  90. <u--image :showLoading="true" :src="'/static/imgs/card/address'+item.icon+'.png'" width="13px"
  91. height="16px"></u--image>
  92. <view class='icon-text'>{{ item.province }}{{ item.city }}{{ item.area }}</view>
  93. </view>
  94. <view @click="freeTell(item)" class="row4 flex">
  95. <u--image :showLoading="true" :src="'/static/imgs/card/phone'+item.icon+'.png'" width="12px"
  96. height="13px"></u--image>
  97. <view class='icon-text'>{{ item.phone }}</view>
  98. </view>
  99. <view @click='remarkEdit(item)' class="row2 flex" style="color: #808080">
  100. <u--image :showLoading="true" :src="'/static/imgs/card/remark'+item.icon+'.png'" width="10px"
  101. height="12px"></u--image>
  102. <view class='icon-text' style="color: #808080;">{{item.remark?item.remark:'单击添加备注'}}
  103. </view>
  104. </view>
  105. </view>
  106. <view class="left">
  107. <u--image :showLoading="true" :src="item.headSculpture" width="66px" height="66px"
  108. shape="circle" v-if="item.headSculpture"></u--image>
  109. <u--image :showLoading="true" src="/static/imgs/card/defaulthead.png" width="66px"
  110. height="66px" shape="circle" v-else></u--image>
  111. </view>
  112. <u-checkbox-group v-if='islongPress' placement="column"
  113. @change="checkboxChange($event,index)">
  114. <u-checkbox iconColor='#4977FC' activeColor="#fff" :name='index+1'
  115. :checked='item.checked' :customStyle="{marginBottom: '8px'}">
  116. </u-checkbox>
  117. </u-checkbox-group>
  118. </view>
  119. <view class="card-content style2" v-if="item.cuttentTemplate==3">
  120. <view class="top">
  121. <u--image :showLoading="true" :src="item.headSculpture" width="66px" height="66px"
  122. shape="circle" v-if="item.headSculpture"></u--image>
  123. <u--image :showLoading="true" src="/static/imgs/card/defaulthead.png" width="66px"
  124. height="66px" shape="circle" v-else></u--image>
  125. </view>
  126. <view class="bottom flex">
  127. <view class="left">
  128. <view class="row1">
  129. <text class="name">{{item.name}}</text>
  130. <text class="post">{{item.post}}</text>
  131. </view>
  132. <view class="row2">
  133. {{item.companyName}}
  134. </view>
  135. </view>
  136. <view class="right">
  137. <view @click="toMap(item)" class="row1 flex">
  138. <u--image :showLoading="true" :src="'/static/imgs/card/address'+item.icon+'.png'" width="13px"
  139. height="16px"></u--image>
  140. <view class='icon-text'>{{ item.province }}{{ item.city }}{{ item.area }}</view>
  141. </view>
  142. <view @click="freeTell(item)" class="row2 flex">
  143. <u--image :showLoading="true" :src="'/static/imgs/card/phone'+item.icon+'.png'" width="12px"
  144. height="13px"></u--image>
  145. <view class='icon-text'>{{ item.phone }}</view>
  146. </view>
  147. <view @click='remarkEdit(item)' class="row2 flex" style="color: #808080">
  148. <u--image :showLoading="true" :src="'/static/imgs/card/remark'+item.icon+'.png'" width="10px"
  149. height="12px"></u--image>
  150. <view class='icon-text' style="color: #808080;">
  151. {{item.remark?item.remark:'单击添加备注'}}
  152. </view>
  153. </view>
  154. </view>
  155. </view>
  156. <u-checkbox-group v-if='islongPress' placement="column"
  157. @change="checkboxChange($event,index)">
  158. <u-checkbox iconColor='#4977FC' activeColor="#fff" :name='index+1'
  159. :checked='item.checked' :customStyle="{marginBottom: '8px'}">
  160. </u-checkbox>
  161. </u-checkbox-group>
  162. </view>
  163. <view class="card-content style2" v-if="item.cuttentTemplate==4">
  164. <view class="top">
  165. <view class="row1">
  166. <text class="name">{{item.name}}</text>
  167. <text class="post">{{item.post}}</text>
  168. </view>
  169. <view class="row2">
  170. {{item.companyName}}
  171. </view>
  172. </view>
  173. <view class="bottom flex">
  174. <view class="left">
  175. <u--image :showLoading="true" :src="item.headSculpture" width="66px" height="66px"
  176. shape="circle" v-if="item.headSculpture"></u--image>
  177. <u--image :showLoading="true" src="/static/imgs/card/defaulthead.png"
  178. width="66px" height="66px" shape="circle" v-else></u--image>
  179. </view>
  180. <view class="right">
  181. <view @click="toMap(item)" class="row1 flex">
  182. <u--image :showLoading="true" :src="'/static/imgs/card/address'+item.icon+'.png'" width="13px"
  183. height="16px"></u--image>
  184. <view class='icon-text'>{{ item.province }}{{ item.city }}{{ item.area }}</view>
  185. </view>
  186. <view @click="freeTell(item)" class="row2 flex">
  187. <u--image :showLoading="true" :src="'/static/imgs/card/phone'+item.icon+'.png'" width="12px"
  188. height="13px"></u--image>
  189. <view class='icon-text'>{{ item.phone }}</view>
  190. </view>
  191. <view @click='remarkEdit(item)' class="row2 flex" style="color: #808080">
  192. <u--image :showLoading="true" :src="'/static/imgs/card/remark'+item.icon+'.png'" width="10px"
  193. height="12px"></u--image>
  194. <view :style='item.remark?"color:#000;":"color:#808080;"' class='icon-text'>
  195. {{item.remark?item.remark:'单击添加备注'}}
  196. </view>
  197. </view>
  198. </view>
  199. </view>
  200. <u-checkbox-group v-if='islongPress' placement="column"
  201. @change="checkboxChange($event,index)">
  202. <u-checkbox iconColor='#4977FC' activeColor="#fff" :name='index+1'
  203. :checked='item.checked' :customStyle="{marginBottom: '8px'}">
  204. </u-checkbox>
  205. </u-checkbox-group>
  206. </view>
  207. <view class="car-bottom flex">
  208. <view class="left">
  209. <image src="../../static/imgs/card/home.png" mode="widthFix" style="width: 32rpx;height: auto;"
  210. @click="toHome(item)"></image>
  211. <text @click='switchType(item)'
  212. style="color: #fff;font-size: 36rpx;font-weight: 700;">{{item.classify?item.classifyName:'默'}}</text>
  213. <image v-if='item.shareCard==1' src="../../static/imgs/card/share.png" mode="widthFix"
  214. style="width: 35rpx;height: auto;" @click="share(item)"></image>
  215. <image v-if='item.shareCard==0' src="../../static/imgs/card/share_grey.png"
  216. mode="widthFix" style="width: 40rpx;height: auto;"></image>
  217. </view>
  218. <view class="right">
  219. </view>
  220. </view>
  221. </view>
  222. </view>
  223. </mescroll-uni>
  224. </view>
  225. <view class="del-style" v-if="islongPress">
  226. <view class="left">
  227. <text class="qx" @click="islongPress=false">取消</text>
  228. <text class="del" @click="del">删除</text>
  229. </view>
  230. <view style='width:128rpx;' class="right flex">
  231. <view>全选</view>
  232. <u-checkbox-group class='' placement="column" @change="checkboxChange($event,'')">
  233. <u-checkbox iconColor='#4977FC' activeColor="#fff" name='全选' :checked='checked'
  234. :customStyle="{marginBottom: '8px',position: 'relative',top: '-19px',right:'-8px'}">
  235. </u-checkbox>
  236. </u-checkbox-group>
  237. </view>
  238. </view>
  239. <u-picker :immediateChange ="true" :show="isShowType" :columns="typeColumns" keyName="circleName" :title="type == 2?'修改分类':'选择分类'"
  240. @close="isShowType=false" @cancel="isShowType=false" closeOnClickOverlay @confirm="typeConfirm"></u-picker>
  241. <u-toast ref="uToast"></u-toast>
  242. <u-modal :show="delShow" title="提示" confirmText='确定' showCancelButton='true' @cancel="delShow=false"
  243. @confirm="delConfirm" :content='"已选中"+this.checkedList.length+"张名片,确定删除?"'></u-modal>
  244. <u-modal :show="modalShow" @confirm='remarkConfirm' :confirmColor="remark?'#2979ff':'#ccc'"
  245. showCancelButton='true' title="备注" @cancel="modalShow=false">
  246. <view class="slot-content">
  247. <u--textarea v-model="remark" placeholder="输入备注,不超过150个字"></u--textarea>
  248. </view>
  249. </u-modal>
  250. <u-popup :show="qrcodeShow" @close="qrcodeShow=false" mode="center" :round='10'>
  251. <image style='margin:10px;height: auto;' :src="currectData.qrCode" mode="widthFix"></image>
  252. </u-popup>
  253. <u-popup :show="popupshow" :closeOnClickOverlay='true' :overlayOpacity='0.4' @close='handleHiddenShare'
  254. :round="10" mode="bottom">
  255. <view>
  256. <!-- <view class="share-to">
  257. <text>分享到</text>
  258. </view> -->
  259. <view class="share-content">
  260. <view class="block" @click="toUrl()">
  261. <button class="moment">
  262. <image style='width:108rpx;height:108rpx;' src="@/static/imgs/scancode.png"
  263. mode="aspectFill"></image>
  264. <view>扫码分享</view>
  265. </button>
  266. </view>
  267. <view class="block">
  268. <button class="shareBtn" type="default" data-name="shareBtn" open-type="share">
  269. <image style='width:108rpx;height:108rpx;' src="@/static/imgs/shade.png" mode="aspectFill">
  270. </image>
  271. <view>分享微信好友</view>
  272. </button>
  273. </view>
  274. </view>
  275. </view>
  276. </u-popup>
  277. <!-- <image :src="poster" style="width: 750rpx;height: 1334rpx;"></image> -->
  278. <!-- 生成图片 -->
  279. <poster :data="canvasData" background-color="#FFF" :width='750' :height='420' @on-success="posterSuccess"
  280. ref="poster" @on-error="posterError"></poster>
  281. <!-- #ifdef MP-WEIXIN -->
  282. <!-- <u-popup :show="isPhone" mode="center" :round="10">
  283. <view class='sq-view'>
  284. <view class="text">
  285. 手机登录后才能查看名片哦~
  286. </view>
  287. <button class="confirm" open-type="getPhoneNumber" @getphonenumber="getPhoneNumber">授权手机号</button>
  288. </view>
  289. </u-popup> -->
  290. <u-modal :show="showAuthorizePhone"
  291. :showConfirmButton="false">
  292. <view class="slot-content">
  293. <div class="auth-card">
  294. <div class="img">
  295. <img class="avatar-img"
  296. src="@/static/imgs/logo.png"
  297. mode="widthFix">
  298. </div>
  299. <!-- <div class="title">手机登录后才能查看名片哦~</div> -->
  300. <div class="content">手机登录后才能查看名片哦~</div>
  301. </div>
  302. <div class="auth-btncard">
  303. <div class="btn-unok"><u-button :customStyle="customStyleUnOk" @click="showAuthorizePhone=false"> 拒绝</u-button></div>
  304. <div class="btn-ok"><u-button :customStyle="customStyleOk" open-type="getPhoneNumber" @getphonenumber="getPhoneNumber"> 立即登录</u-button></div>
  305. </div>
  306. </view>
  307. </u-modal>
  308. <u-modal :show="showAuthorizeUser"
  309. :showConfirmButton="false">
  310. <view class="slot-content">
  311. <div class="auth-card">
  312. <div class="img">
  313. <img class="avatar-img"
  314. src="/static/imgs/logo.png"
  315. mode="widthFix">
  316. </div>
  317. <div class="content">邀请您补全个人信息<br></br>(昵称、头像)</div>
  318. <div style="margin-left: 100rpx;margin-right: 100rpx">
  319. <u-form :model="userInfo" ref="uForm">
  320. <u-form-item label="头像">
  321. <button class="avatar-wrapper" open-type="chooseAvatar" @chooseavatar="onChooseAvatar" slot="right">
  322. <image class="avatar" :src="userInfo.head?userInfo.head:'https://mmbiz.qpic.cn/mmbiz/icTdbqWNOwNRna42FI242Lcia07jQodd2FJGIYQfG0LAJGFxM4FbnQP6yfMxBgJ0F3YRqJCJ1aPAK2dQagdusBZg/0'"></image>
  323. </button>
  324. </u-form-item>
  325. <u-form-item label="昵称">
  326. <u-input inputAlign='right' v-model="userInfo.nickname" class="weui-input" @blur="userNameInput" placeholder="请输入昵称" border="false"/>
  327. <!-- <input type="nickname" :value="userInfo.nickname" class="weui-input" @blur="userNameInput" placeholder="请输入昵称"/> -->
  328. </u-form-item>
  329. </u-form>
  330. </div>
  331. </div>
  332. <div class="auth-btncard">
  333. <div class="btn-unok"><u-button :customStyle="customStyleUnOk" @click="showAuthorizeUser=false"> 拒绝</u-button></div>
  334. <div class="btn-ok"><u-button :customStyle="customStyleOk" @click="authUser"> 允许</u-button></div>
  335. </div>
  336. </view>
  337. </u-modal>
  338. <!-- #endif -->
  339. <u-toast ref="uToast"></u-toast>
  340. </view>
  341. </template>
  342. <script>
  343. var that;
  344. import Poster from '../../components/zhangyuhao-poster/Poster.vue'
  345. import { pathToBase64, base64ToPath } from 'image-tools'
  346. import MescrollMixin from "@/uni_modules/mescroll-uni/components/mescroll-uni/mescroll-mixins.js";
  347. export default {
  348. mixins: [MescrollMixin],
  349. components: {
  350. Poster
  351. },
  352. data() {
  353. return {
  354. userInfo: {head:'',nickname:''},
  355. downOption: {
  356. auto: false,
  357. textColor:'#bbb'
  358. },
  359. upOption: {
  360. page: {
  361. size: 10 // 每页数据的数量,默认10
  362. },
  363. auto: false,
  364. noMoreSize: 1,
  365. empty: {
  366. tip: '暂无相关数据'
  367. },
  368. textNoMore:'没有更多了~',
  369. textColor:'#bbb'
  370. },
  371. params: {
  372. encryptedData: '',
  373. session_key: '',
  374. iv: '',
  375. },
  376. key: '',
  377. isPhone: false,
  378. canReset: false,
  379. poster: '',
  380. canvasData: {},
  381. searchVal: '',
  382. isShowType: false,
  383. loading: true,
  384. typeName: '',
  385. typeColumns: [],
  386. cardHolderList: [],
  387. currectData: [],
  388. type: 1,
  389. popupshow: false,
  390. modalShow: false,
  391. remark: '',
  392. islongPress: false,
  393. checked: false,
  394. checkedList: [],
  395. delShow: false,
  396. qrcodeShow: false,
  397. unread: 0,
  398. clicknum: 0,
  399. noticeList: [],
  400. status: 0,
  401. // 是否弹出登录注册授权弹窗
  402. showAuthorizeUser: false,
  403. showAuthorizePhone: false,
  404. customStyleUnOk: {
  405. marginTop: '20rpx', // 注意驼峰命名,并且值必须用引号包括,因为这是对象
  406. border:'none',
  407. color:'gray'
  408. },
  409. customStyleOk: {
  410. marginTop: '20rpx', // 注意驼峰命名,并且值必须用引号包括,因为这是对象
  411. border:'none',
  412. color:'#157DFB'
  413. },
  414. };
  415. },
  416. mounted() {
  417. },
  418. onShow:function(){
  419. let _isLoad = uni.getStorageSync("scanAddCardToIndex")
  420. this.searchVal = uni.getStorageSync("search_val") ? uni.getStorageSync("search_val") : ''
  421. if(this.searchVal||_isLoad) this.mescroll.resetUpScroll();
  422. },
  423. onLoad: function(options) {
  424. that = this
  425. console.log(uni.getLaunchOptionsSync().scene, 1011)
  426. if (uni.getStorageSync("userInfo").phone) {
  427. this.userInfo = uni.getStorageSync("userInfo")
  428. this.$nextTick(function() {
  429. that.mescroll.resetUpScroll()
  430. that.$request.baseRequest('admin.unimall.cardNewsInfo', 'list', {
  431. receiveId: uni.getStorageSync("userInfo").id,
  432. }, failres => {
  433. console.log('res+++++', failres.errmsg)
  434. that.$refs.uToast.show({
  435. type: 'error',
  436. message: failres.errmsg,
  437. })
  438. }).then(res => {
  439. that.noticeList = res.data.items
  440. if (that.noticeList.length > 0) {
  441. var data = that.noticeList.filter((item) => {
  442. return item.newsFlag == 0
  443. })
  444. that.unread = data ? data.length : 0
  445. }
  446. console.log(that.unread)
  447. })
  448. wx.showShareMenu({
  449. withShareTicket: true,
  450. menus: ["shareAppMessage", "shareTimeline"]
  451. })
  452. });
  453. } else {
  454. if (uni.getLaunchOptionsSync().scene != 1154) {
  455. this.login()
  456. }
  457. }
  458. this.status = uni.getLaunchOptionsSync().scene
  459. if (uni.getLaunchOptionsSync().scene == 1154) {
  460. uni.showToast({
  461. title: '请前往小程序查看名片',
  462. icon: 'none',
  463. duration: 10000
  464. });
  465. }
  466. },
  467. onShareAppMessage(res) {
  468. console.log(res, this.popupshow)
  469. let that = this;
  470. //生成名片图片
  471. let imageUrl = this.poster
  472. console.log("imageUrl", imageUrl)
  473. if (res.from === 'button') {
  474. let path = `/pages/cardHolder/scanCodeAddCard?id=${that.currectData.id}`
  475. return {
  476. title: this.popupshow ? `${that.currectData.name}分享的名片~` : '电子名片',
  477. path: path,
  478. imageUrl: this.popupshow ? imageUrl : '',
  479. };
  480. }
  481. if (res.from === 'menu') {
  482. return {
  483. title: '名片夹',
  484. path: '/pages/tabBarPro/index/index',
  485. imageUrl: this.popupshow ? imageUrl : ''
  486. };
  487. }
  488. },
  489. methods: {
  490. //获取昵称输入内容
  491. userNameInput(e){
  492. this.userInfo.nickname = e.detail.value
  493. },
  494. async onChooseAvatar(e) {
  495. this.$set(this.userInfo,"head",await this.toBase64(e.detail.avatarUrl))
  496. },
  497. toBase64(url){
  498. return new Promise(resolve => {
  499. pathToBase64(url).then(path => {
  500. resolve(path);
  501. }).catch(error => {
  502. console.log(error)
  503. })
  504. })
  505. },
  506. authUser(){
  507. if(this.userInfo.nickname==''){
  508. uni.showToast({
  509. icon:"none",
  510. title: '请输入您的昵称',
  511. duration: 2000
  512. });
  513. return;
  514. }
  515. this.getTokenAsync1()
  516. },
  517. downCallback(){
  518. this.mescroll.resetUpScroll()
  519. },
  520. freeTell(item) {
  521. uni.makePhoneCall({
  522. phoneNumber: item.phone, //仅为示例,并非真实的电话号码
  523. success: function() {
  524. console.log("拨打电话成功!")
  525. },
  526. fail: function() {
  527. console.log("拨打电话失败!")
  528. }
  529. })
  530. },
  531. getPhoneNumber(e) {
  532. console.log(e)
  533. if (e.mp.detail.errMsg === "getPhoneNumber:ok") {
  534. this.isPhone = false
  535. this.params.iv = e.mp.detail.iv
  536. this.params.encryptedData = e.mp.detail.encryptedData
  537. this.params.session_key = this.accessToken
  538. console.log(this.params)
  539. let appId = 'wx5d8906c2208c899f'
  540. let sessionKey = this.userInfo.sessionKey
  541. let encryptedData = this.params.encryptedData
  542. let iv = this.params.iv
  543. let pc = this.$WXBizDataCrypt(appId, sessionKey)
  544. let data = this.$WXBizDataCrypt.prototype.decryptData(encryptedData, iv, appId, sessionKey)
  545. console.log('解密后 data: ', data)
  546. this.showAuthorizePhone = false
  547. this.getTokenAsync(data)
  548. }
  549. },
  550. async getTokenAsync(val) {
  551. let that = this
  552. that.userInfo.phone = val.phoneNumber
  553. that.$request.baseRequest('commonUserApp', 'edit', {
  554. commonUserInfo: JSON.stringify(that.userInfo)
  555. }, failres => {
  556. uni.showToast({
  557. icon:"none",
  558. title: failres.errmsg,
  559. duration: 3000
  560. });
  561. uni.hideLoading()
  562. }).then(res1 => {
  563. that.userInfo = res1.data
  564. uni.setStorageSync("userInfo", that.userInfo)
  565. that.showAuthorizeUser = true
  566. that.mescroll.resetUpScroll()
  567. })
  568. },
  569. async getTokenAsync1() {
  570. let that = this
  571. that.$request.baseRequest('commonUserApp', 'edit', {
  572. commonUserInfo: JSON.stringify(that.userInfo)
  573. }, failres => {
  574. uni.showToast({
  575. icon:"none",
  576. title: failres.errmsg,
  577. duration: 3000
  578. });
  579. uni.hideLoading()
  580. }).then(res1 => {
  581. that.userInfo = res1.data
  582. uni.setStorageSync("userInfo", that.userInfo)
  583. that.showAuthorizeUser = false
  584. that.mescroll.resetUpScroll()
  585. })
  586. },
  587. delVal() {
  588. this.searchVal = ""
  589. this.mescroll.resetUpScroll()
  590. },
  591. handleHiddenShare() {
  592. console.log(11111)
  593. this.popupshow = false
  594. },
  595. posterError(err) {
  596. console.log(err)
  597. uni.hideLoading()
  598. },
  599. posterSuccess(url) {
  600. console.log("hahahah", url)
  601. // 生成成功,会把临时路径在这里返回
  602. this.poster = url;
  603. this.popupshow = true
  604. console.log(url)
  605. uni.hideLoading()
  606. },
  607. toHome(item) {
  608. uni.navigateTo({
  609. url: "/pages/circle/lookHome?id=" + item.personalHomeId
  610. })
  611. },
  612. delSearchVal() {
  613. this.searchVal = ""
  614. uni.removeStorageSync('search_val')
  615. this.mescroll.resetUpScroll()
  616. },
  617. toUrl() {
  618. console.log(this.currectData)
  619. this.popupshow = false
  620. this.qrcodeShow = true
  621. },
  622. share(item) {
  623. uni.showLoading({
  624. title: '加载中',
  625. mask: true
  626. })
  627. this.currectData = item
  628. var data = [{
  629. type: 'image',
  630. path: this.currectData.currentBackground,
  631. use: 'bg',
  632. x: -10,
  633. y: 0,
  634. width: 530,
  635. height: 325
  636. },
  637. {
  638. type: 'image',
  639. path: this.currectData.headSculpture?this.currectData.headSculpture:'../../static/imgs/card/defaulthead.png',
  640. shape: 'circle',
  641. use: 'head',
  642. imageType:this.currectData.headSculpture?'wl':'bd',
  643. x: 30,
  644. y: 30,
  645. width: 100,
  646. height: 100
  647. },
  648. {
  649. type: 'text',
  650. text: this.currectData.name,
  651. use: 'name',
  652. x: 150,
  653. y: 50,
  654. size: 24,
  655. color: '#000'
  656. },
  657. {
  658. type: 'text',
  659. text: this.currectData.post,
  660. use: 'post',
  661. x: 240,
  662. y: 55,
  663. size: 18,
  664. color: '#666666'
  665. },
  666. {
  667. type: 'text',
  668. text: this.currectData.companyName,
  669. use: 'companyName',
  670. x: 150,
  671. y: 95,
  672. size: 18,
  673. color: '#000'
  674. },
  675. {
  676. type: 'image',
  677. path: '../../static/imgs/card/address1.png',
  678. use: 'address-icon',
  679. x: 145,
  680. y: 130,
  681. width: 15,
  682. height: 20
  683. },
  684. {
  685. type: 'textarea',
  686. text: this.currectData.province + this.currectData.city + this.currectData.area + this
  687. .currectData.detailedAddress,
  688. lineSpace: 1,
  689. width: 320,
  690. use: 'address',
  691. x: 175,
  692. y: 135,
  693. size: 14,
  694. color: '#000'
  695. },
  696. {
  697. type: 'image',
  698. path: '../../static/imgs/card/phone1.png',
  699. use: 'phone-icon',
  700. x: 145,
  701. y: 163,
  702. width: 16,
  703. height: 16
  704. },
  705. {
  706. type: 'text',
  707. text: this.currectData.phone,
  708. use: 'phone',
  709. x: 175,
  710. y: 167,
  711. size: 14,
  712. color: '#000'
  713. },
  714. {
  715. type: 'image',
  716. path: '../../static/imgs/card/remark1.png',
  717. use: 'remark-icon',
  718. x: 145,
  719. y: 197,
  720. width: 13,
  721. height: 16
  722. },
  723. {
  724. type: 'textarea',
  725. text: this.currectData.remark ? this.currectData.remark : '单击添加备注',
  726. use: 'remark',
  727. lineSpace: 2,
  728. width: 200,
  729. x: 175,
  730. y: 200,
  731. size: 13,
  732. color: '#000'
  733. },
  734. {
  735. type: 'image',
  736. path: '../../static/imgs/card/bg3.png',
  737. use: 'bg1',
  738. x: 0,
  739. y: 243,
  740. width: 370,
  741. height: 67
  742. },
  743. {
  744. type: 'image',
  745. path: '../../static/imgs/card/bg4.png',
  746. use: 'bg2',
  747. x: 355,
  748. y: 243,
  749. width: 150,
  750. height: 67
  751. },
  752. {
  753. type: 'image',
  754. path: '../../static/imgs/card/home.png',
  755. use: 'home',
  756. x: 65,
  757. y: 260,
  758. width: 33,
  759. height: 33
  760. },
  761. {
  762. type: 'text',
  763. text: this.currectData.classifyName ? this.currectData.classifyName : '默',
  764. use: 'classify',
  765. x: 145,
  766. y: 263,
  767. size: 34,
  768. color: '#fff'
  769. },
  770. {
  771. type: 'image',
  772. path: '../../static/imgs/card/share.png',
  773. use: 'share',
  774. x: 235,
  775. y: 263,
  776. width: 33,
  777. height: 28
  778. },
  779. ]
  780. console.log(this.currectData.cuttentTemplate, 111111)
  781. for (var i = 0; i < data.length; i++) {
  782. switch (this.currectData.cuttentTemplate) {
  783. case '2':
  784. if (data[i].use === 'name' ||
  785. data[i].use === 'companyName' ||
  786. data[i].use === 'address-icon' ||
  787. data[i].use === 'phone-icon' ||
  788. data[i].use === 'remark-icon') {
  789. data[i].x = 30
  790. }
  791. if (data[i].use === 'address-icon') {
  792. data[i].path = '../../static/imgs/card/address3.png'
  793. }
  794. if (data[i].use === 'phone-icon') {
  795. data[i].path = '../../static/imgs/card/phone3.png'
  796. }
  797. if (data[i].use === 'remark-icon') {
  798. data[i].path = '../../static/imgs/card/remark3.png'
  799. }
  800. if (data[i].use === 'post') {
  801. data[i].x = 100
  802. }
  803. if (data[i].use === 'address' ||
  804. data[i].use === 'phone' ||
  805. data[i].use === 'remark') {
  806. data[i].x = 60
  807. }
  808. if (data[i].use == 'head') {
  809. data[i].x = 370
  810. }
  811. break;
  812. case '3':
  813. if (data[i].use === 'name') {
  814. data[i].x = 30
  815. data[i].y = 150
  816. }
  817. if (data[i].use === 'companyName') {
  818. data[i].x = 30
  819. data[i].y = 180
  820. }
  821. if (data[i].use === 'post') {
  822. data[i].x = 100
  823. data[i].y = 153
  824. }
  825. if (data[i].use === 'address-icon' ||
  826. data[i].use === 'phone-icon' ||
  827. data[i].use === 'remark-icon') {
  828. data[i].x = 170
  829. }
  830. if (data[i].use === 'address-icon') {
  831. data[i].y = 150
  832. }
  833. if (data[i].use === 'address') {
  834. data[i].y = 155;
  835. data[i].width = 300
  836. }
  837. if (data[i].use === 'phone-icon') {
  838. data[i].y = 180
  839. }
  840. if (data[i].use === 'phone') {
  841. data[i].y = 183
  842. }
  843. if (data[i].use === 'remark-icon') {
  844. data[i].y = 210
  845. }
  846. if (data[i].use === 'remark') {
  847. data[i].y = 212
  848. }
  849. if (data[i].use === 'address' ||
  850. data[i].use === 'phone' ||
  851. data[i].use === 'remark') {
  852. data[i].x = 190
  853. }
  854. break;
  855. case '4':
  856. if (data[i].use === 'name' ||
  857. data[i].use === 'companyName') {
  858. data[i].x = 30
  859. }
  860. if (data[i].use === 'companyName') {
  861. data[i].y = 90
  862. }
  863. if (data[i].use === 'post') {
  864. data[i].x = 100
  865. }
  866. if (data[i].use == 'head') {
  867. data[i].x = 25
  868. data[i].y = 120
  869. }
  870. if (data[i].use === 'address-icon') {
  871. data[i].path = '../../static/imgs/card/address2.png'
  872. }
  873. if (data[i].use === 'phone-icon') {
  874. data[i].path = '../../static/imgs/card/phone2.png'
  875. }
  876. if (data[i].use === 'remark-icon') {
  877. data[i].path = '../../static/imgs/card/remark2.png'
  878. }
  879. if (data[i].use === 'address-icon' ||
  880. data[i].use === 'phone-icon' ||
  881. data[i].use === 'remark-icon') {
  882. data[i].x = 170
  883. }
  884. if (data[i].use === 'address') {
  885. data[i].width = 300
  886. }
  887. if (data[i].use === 'address' ||
  888. data[i].use === 'phone' ||
  889. data[i].use === 'remark') {
  890. data[i].x = 190
  891. }
  892. break;
  893. default:
  894. }
  895. }
  896. this.canvasData = {
  897. clicknum: this.clicknum++,
  898. list: data,
  899. page: 'cardHolder'
  900. }
  901. },
  902. async delConfirm() {
  903. uni.showLoading({
  904. title: '数据加载中',
  905. mask: true
  906. })
  907. for (var i = 0; i < this.checkedList.length; i++) {
  908. await this.$request.baseRequest('admin.unimall.cardHolderInfo', 'delete', {
  909. id: this.checkedList[i].data.id,
  910. }, failres => {
  911. console.log('res+++++', failres.errmsg)
  912. uni.showToast({
  913. icon:"none",
  914. title: failres.errmsg,
  915. duration: 3000
  916. });
  917. }).then(res => {
  918. console.log(i, this.checkedList.length - 1)
  919. if (i == this.checkedList.length - 1) {
  920. uni.hideLoading()
  921. uni.showToast({
  922. icon:"success",
  923. title: '删除成功!',
  924. duration: 2000
  925. });
  926. this.delShow = false
  927. this.islongPress = false
  928. this.mescroll.resetUpScroll()
  929. }
  930. })
  931. }
  932. },
  933. del() {
  934. if (this.checkedList.length > 0) {
  935. this.delShow = true
  936. } else {
  937. uni.showToast({
  938. icon:"none",
  939. title: '请勾选后再进行删除',
  940. duration: 2000
  941. });
  942. }
  943. },
  944. longpress() {
  945. console.log("长按事件", 1111111111);
  946. this.islongPress = true;
  947. },
  948. checkboxChange(e, i) {
  949. console.log(e, i, 111111111)
  950. if (i === '') {
  951. console.log(this.checked)
  952. this.checked = !this.checked;
  953. this.cardHolderList.map(item => item.checked = this.checked);
  954. this.$forceUpdate()
  955. var checkList = this.cardHolderList.filter((item) => {
  956. return item.checked == true
  957. })
  958. var data = checkList.map((item, index) => {
  959. return {
  960. index: index,
  961. data: item
  962. }
  963. })
  964. this.checkedList = JSON.parse(JSON.stringify(data))
  965. } else {
  966. if (e[0]) {
  967. this.checkedList.push({
  968. index: i,
  969. data: this.cardHolderList[i]
  970. })
  971. } else {
  972. var index = this.checkedList.findIndex((item) => {
  973. return item.index == i
  974. })
  975. this.checkedList.splice(index, 1)
  976. }
  977. if (this.checkedList.length != this.cardHolderList.length) {
  978. this.checked = false
  979. }
  980. }
  981. // for(var i=0;i<this.cardList.length;i++){
  982. // console.log(this.cardList[i].checked)
  983. // // if(this.cardList[i].checkedList.length>0){
  984. // // this.checkedList.push(i)
  985. // // }
  986. // }
  987. console.log(this.checkedList)
  988. },
  989. remarkConfirm() {
  990. if (this.remark) {
  991. this.currectData.remark = this.remark
  992. this.$request.baseRequest('admin.unimall.cardHolderInfo', 'update', {
  993. cardHolderInfo: JSON.stringify(this.currectData),
  994. }, failres => {
  995. console.log('res+++++', failres.errmsg)
  996. uni.showToast({
  997. icon:"none",
  998. title: failres.errmsg,
  999. duration: 3000
  1000. });
  1001. }).then(res => {
  1002. uni.showToast({
  1003. icon:"success",
  1004. title: '修改备注成功!',
  1005. duration: 2000
  1006. });
  1007. this.remark=''
  1008. this.modalShow = false
  1009. this.mescroll.resetUpScroll()
  1010. })
  1011. }
  1012. },
  1013. remarkEdit(item) {
  1014. this.currectData = item
  1015. this.remark = this.currectData.remark
  1016. this.modalShow = true
  1017. },
  1018. switchType(item) {
  1019. this.type = 2
  1020. this.typeColumns[0].shift()
  1021. this.currectData = item
  1022. this.isShowType = true
  1023. },
  1024. typeConfirm(e) {
  1025. if (this.type == 2) {
  1026. console.log(e.value[0].circleName,"123312132")
  1027. this.$set(this.currectData,'classify',e.value[0].circleName)
  1028. this.$request.baseRequest('admin.unimall.cardHolderInfo', 'update', {
  1029. cardHolderInfo: JSON.stringify(this.currectData),
  1030. }, failres => {
  1031. console.log('res+++++', failres.errmsg)
  1032. uni.showToast({
  1033. icon:"none",
  1034. title: failres.errmsg,
  1035. duration: 3000
  1036. });
  1037. }).then(res => {
  1038. uni.showToast({
  1039. icon:"success",
  1040. title: '修改分类成功!',
  1041. duration: 2000
  1042. });
  1043. this.mescroll.resetUpScroll()
  1044. })
  1045. } else {
  1046. this.typeName = e.value[0].circleName
  1047. if(this.typeName =="全部分类") this.typeName = ''
  1048. this.mescroll.resetUpScroll()
  1049. }
  1050. this.isShowType = false
  1051. },
  1052. async upCallback(page) {
  1053. if (uni.getLaunchOptionsSync().scene == 1154) {
  1054. uni.showToast({
  1055. title: '请前往小程序查看名片',
  1056. icon: 'none',
  1057. duration: 10000
  1058. });
  1059. } else {
  1060. var that = this
  1061. if(uni.getStorageSync("userInfo").id){
  1062. uni.showLoading({
  1063. title: '数据加载中'
  1064. })
  1065. await this.$request.baseRequest('admin.unimall.cardHolderInfo', 'list', {
  1066. page: page.num,
  1067. limit: page.size,
  1068. commonId: uni.getStorageSync("userInfo").id,
  1069. searchContent: this.searchVal,
  1070. classify:this.typeName
  1071. }, failres => {
  1072. console.log('res+++++', failres.errmsg)
  1073. uni.showToast({
  1074. icon:"none",
  1075. title: failres.errmsg,
  1076. duration: 3000
  1077. });
  1078. uni.hideLoading()
  1079. }).then(res => {
  1080. console.log(res)
  1081. if (page.num == 1) this.cardHolderList = [];
  1082. let curPageLen = res.data.items.length;
  1083. let totalPage = res.data.total;
  1084. for (var i = 0; i < res.data.items.length; i++) {
  1085. res.data.items[i].checked = false
  1086. if (res.data.items[i].classify) {
  1087. res.data.items[i].classifyName = res.data.items[i].classify[0]
  1088. }
  1089. }
  1090. this.cardHolderList = res.data.items
  1091. this.loading = false
  1092. this.$nextTick(() => {
  1093. that.mescroll.endBySize(curPageLen, totalPage)
  1094. });
  1095. uni.hideLoading()
  1096. })
  1097. await this.$request.baseRequest('admin.unimall.cardClassifyInfo', 'list', {
  1098. page: 1,
  1099. limit: 9999,
  1100. commonId: uni.getStorageSync("userInfo").id
  1101. }, failres => {
  1102. console.log('res+++++', failres.errmsg)
  1103. uni.showToast({
  1104. icon:"none",
  1105. title: failres.errmsg,
  1106. duration: 3000
  1107. });
  1108. }).then(res => {
  1109. res.data.items.unshift({
  1110. circleName:'全部分类'
  1111. })
  1112. this.typeColumns = [res.data.items]
  1113. console.log(this.typeColumns)
  1114. })
  1115. //清楚扫码添加跳页刷新数据状态开关
  1116. uni.setStorageSync("scanAddCardToIndex",0)
  1117. }
  1118. }
  1119. },
  1120. login() {
  1121. let that = this
  1122. uni.login({
  1123. "provider": "weixin",
  1124. success: function(wxres) {
  1125. that.$request.baseRequest('commonUserApp', 'commonUserLogin', {
  1126. loginType: 1,
  1127. raw: JSON.stringify(wxres)
  1128. }, failres => {
  1129. uni.showToast({
  1130. icon:"none",
  1131. title: failres.errmsg,
  1132. duration: 3000
  1133. });
  1134. uni.hideLoading()
  1135. }).then(res => {
  1136. console.log(res.data)
  1137. that.isPhone = true
  1138. that.showAuthorizePhone = true
  1139. that.userInfo = res.data
  1140. })
  1141. },
  1142. fail: function(err) {
  1143. uni.showToast({
  1144. icon:"none",
  1145. title: err.code,
  1146. duration: 3000
  1147. });
  1148. // 登录授权失败
  1149. // err.code是错误码
  1150. }
  1151. })
  1152. },
  1153. toNotice() {
  1154. uni.navigateTo({
  1155. url: "/pages/cardHolder/notice"
  1156. })
  1157. },
  1158. micOpen: function() {
  1159. uni.navigateTo({
  1160. url: "/pages/cardHolder/search?mic=1"
  1161. })
  1162. },
  1163. uploadFile: function(tempFilePath) {
  1164. return new Promise((resolve, reject) => {
  1165. //调用你的接口把音频文件转为文字
  1166. this.$minApi.upload('txasr/SentenceRecognition', null, tempFilePath)
  1167. .then(res => {
  1168. if (res.code == 1) {
  1169. resolve(res.data.Result);
  1170. } else {
  1171. reject(e);
  1172. }
  1173. })
  1174. .catch(e => {
  1175. reject(e);
  1176. });
  1177. });
  1178. },
  1179. search() {
  1180. uni.navigateTo({
  1181. url: "/pages/cardHolder/search"
  1182. })
  1183. },
  1184. input(res) {
  1185. console.log('----input:', res)
  1186. },
  1187. clear(res) {
  1188. uni.showToast({
  1189. title: 'clear事件,清除值为:' + res.value,
  1190. icon: 'none'
  1191. })
  1192. },
  1193. blur(res) {
  1194. uni.showToast({
  1195. title: 'blur事件,输入值为:' + res.value,
  1196. icon: 'none'
  1197. })
  1198. },
  1199. focus(e) {
  1200. uni.showToast({
  1201. title: 'focus事件,输出值为:' + e.value,
  1202. icon: 'none'
  1203. })
  1204. },
  1205. cancel(res) {
  1206. uni.showToast({
  1207. title: '点击取消,输入值为:' + res.value,
  1208. icon: 'none'
  1209. })
  1210. },
  1211. selectType() {
  1212. this.isShowType = true
  1213. this.type = 1
  1214. },
  1215. scan() {
  1216. var that = this
  1217. // console.log(1)
  1218. // uni.navigateTo({
  1219. // url: "/pages/cardHolder/scancode"
  1220. // })
  1221. uni.scanCode({
  1222. success: function(res) {
  1223. console.log('条码类型:' + res.scanType);
  1224. console.log('条码内容:' + res.result);
  1225. console.log(res.result.split("=")[1],res.result.split("=")[1].indexOf(','),res.result.split("=")[1].split(",")[0])
  1226. var cardId=res.result.split("=")[1].split(",")[0]
  1227. that.$request.baseRequest('admin.unimall.cardHolderInfo', 'getAdded', {
  1228. commonId: uni.getStorageSync("userInfo").id,
  1229. cardId:cardId
  1230. }, failres => {
  1231. console.log('res+++++', failres.errmsg)
  1232. uni.showToast({
  1233. icon:"none",
  1234. title: failres.errmsg,
  1235. duration: 3000
  1236. });
  1237. }).then(res1 => {
  1238. uni.navigateTo({
  1239. url: "/pages/cardHolder/scanCodeAddCard?id=" + res.result.split("=")[1]
  1240. })
  1241. })
  1242. }
  1243. });
  1244. },
  1245. toMap(item) {
  1246. uni.navigateTo({
  1247. url: "/pages/cardHolder/map?val=" + JSON.stringify(item)
  1248. })
  1249. },
  1250. }
  1251. }
  1252. </script>
  1253. <style lang="scss" scoped>
  1254. .content {
  1255. // padding: 0 20rpx;
  1256. }
  1257. .u-nav-slot {
  1258. /deep/.u-badge {
  1259. position: absolute;
  1260. top: 0;
  1261. right: 6rpx;
  1262. }
  1263. }
  1264. .content1 {
  1265. padding: 20rpx;
  1266. background-color: #112253;
  1267. .search {
  1268. color: #9199af;
  1269. background: #22325f;
  1270. border-radius: 50rpx;
  1271. width: 93%;
  1272. padding: 10rpx 0 10rpx 30rpx;
  1273. box-sizing: border-box;
  1274. margin-right: 20rpx;
  1275. }
  1276. .left{
  1277. width:80%;
  1278. text{
  1279. height: 46rpx;
  1280. white-space: nowrap;
  1281. overflow: scroll;
  1282. position: relative;
  1283. margin-left: 20rpx;
  1284. }
  1285. }
  1286. .right{
  1287. // width:14%;
  1288. margin-right:20rpx
  1289. }
  1290. }
  1291. .content2 {
  1292. background: #112253;
  1293. color: #fff;
  1294. padding: 20rpx 20rpx 200rpx 20rpx;
  1295. border-radius: 0px 0px 20px 20px;
  1296. }
  1297. .content3 {
  1298. // padding:0 20rpx;
  1299. // position: relative;
  1300. // top: 376rpx;
  1301. margin: 0 20rpx;
  1302. background: #f5f5f5;
  1303. // height: 1000px;
  1304. border-radius: 30rpx;
  1305. .style1 {
  1306. display: flex;
  1307. padding: 20rpx 30rpx;
  1308. width: 85%;
  1309. margin-bottom: 90rpx;
  1310. .left {
  1311. width: 132rpx;
  1312. height: 132rpx;
  1313. border-radius: 50%;
  1314. }
  1315. .right {
  1316. margin-left: 40rpx;
  1317. .row1 {
  1318. .name {
  1319. font-size: 38rpx;
  1320. font-weight: bold;
  1321. color: #040000;
  1322. margin-right: 20rpx;
  1323. }
  1324. .post {
  1325. font-size: 26rpx;
  1326. font-weight: 500;
  1327. color: #666666;
  1328. }
  1329. }
  1330. .row2 {
  1331. font-size: 24rpx;
  1332. font-weight: bold;
  1333. color: #323333;
  1334. }
  1335. .row3 {
  1336. margin-top: 30rpx;
  1337. font-size: 24rpx;
  1338. font-weight: 500;
  1339. color: #323333;
  1340. }
  1341. .row2,
  1342. .row4 {
  1343. margin-top: 10rpx;
  1344. }
  1345. }
  1346. }
  1347. .style2 {
  1348. padding: 15rpx;
  1349. margin-bottom: 80rpx;
  1350. .top {
  1351. .row1 {
  1352. .name {
  1353. font-size: 38rpx;
  1354. font-weight: bold;
  1355. color: #040000;
  1356. margin-right: 20rpx;
  1357. }
  1358. .post {
  1359. font-size: 26rpx;
  1360. font-weight: 500;
  1361. color: #666666;
  1362. }
  1363. }
  1364. .row2 {
  1365. margin-top: 10rpx;
  1366. font-size: 24rpx;
  1367. font-weight: bold;
  1368. color: #323333;
  1369. }
  1370. }
  1371. .bottom {
  1372. margin-top: 20rpx;
  1373. .left {
  1374. margin-right: 40rpx;
  1375. .row1 {
  1376. .name {
  1377. font-size: 38rpx;
  1378. font-weight: bold;
  1379. color: #040000;
  1380. margin-right: 20rpx;
  1381. }
  1382. .post {
  1383. font-size: 26rpx;
  1384. font-weight: 500;
  1385. color: #666666;
  1386. }
  1387. }
  1388. .row2 {
  1389. margin-top: 10rpx;
  1390. font-size: 26rpx;
  1391. font-weight: bold;
  1392. color: #323333;
  1393. }
  1394. }
  1395. .right {
  1396. .row1,
  1397. .row2 {
  1398. font-size: 24rpx;
  1399. font-weight: 500;
  1400. color: #323333;
  1401. }
  1402. .row2,
  1403. .row4 {
  1404. margin-top: 10rpx;
  1405. }
  1406. }
  1407. }
  1408. }
  1409. .card-list-item {
  1410. width: calc(100%);
  1411. // left:-20rpx;
  1412. position: relative;
  1413. border-radius: 30rpx;
  1414. padding: 40rpx;
  1415. box-sizing: border-box;
  1416. .car-bottom {
  1417. position: absolute;
  1418. bottom: 63rpx;
  1419. left: 20rpx;
  1420. bottom: 24rpx;
  1421. width: 94.9%;
  1422. background: url("../../static/imgs/card/bg5.png") no-repeat center;
  1423. background-size: 100% 100%;
  1424. height: 80rpx;
  1425. // width: calc(100% - 40rpx);
  1426. .left {
  1427. // top: -40rpx;
  1428. position: absolute;
  1429. padding: 20rpx 0;
  1430. width: 70vw;
  1431. height: 80rpx;
  1432. box-sizing: border-box;
  1433. display: flex;
  1434. align-items: center;
  1435. justify-content: space-evenly;
  1436. left: 0px;
  1437. // background-size: 100% 100%;
  1438. overflow-y: hidden;
  1439. }
  1440. }
  1441. .left {
  1442. width: 30%;
  1443. .top {
  1444. margin-bottom: 20rpx;
  1445. }
  1446. .img {
  1447. width: 80%;
  1448. }
  1449. .bottom {}
  1450. }
  1451. .right {
  1452. .row1 {
  1453. .line {
  1454. width: 1px;
  1455. height: 20px;
  1456. margin: 0 20rpx;
  1457. background: black;
  1458. }
  1459. }
  1460. }
  1461. }
  1462. }
  1463. .slot-content {
  1464. width: 100%;
  1465. }
  1466. .shade {
  1467. background: rgba(0, 0, 0, 0.2);
  1468. width: 100%;
  1469. height: 100vh;
  1470. position: fixed;
  1471. top: 0;
  1472. left: 0;
  1473. }
  1474. .qrCode {
  1475. position: absolute;
  1476. top: 50%;
  1477. left: 0;
  1478. right: 0;
  1479. transform: translateY(-50%);
  1480. text-align: center;
  1481. }
  1482. /deep/.u-checkbox-group {
  1483. position: absolute;
  1484. right: 20px;
  1485. z-index: 99;
  1486. top: 30px;
  1487. }
  1488. .del-style {
  1489. background: #fff;
  1490. padding: 20rpx;
  1491. width: calc(100vw - 40rpx);
  1492. position: fixed;
  1493. display: flex;
  1494. z-index: 100;
  1495. justify-content: space-between;
  1496. bottom: 0;
  1497. font-size: 28rpx;
  1498. .right {
  1499. color: #344577;
  1500. }
  1501. }
  1502. .del,
  1503. .qx {
  1504. padding: 10rpx;
  1505. }
  1506. .del {
  1507. color: #FF4040;
  1508. }
  1509. .qx {
  1510. color: #666;
  1511. bottom: 0
  1512. }
  1513. .share-content {
  1514. display: flex;
  1515. padding: 20rpx;
  1516. justify-content: center;
  1517. font-size: 24rpx;
  1518. button {
  1519. background: transparent;
  1520. line-height: 1;
  1521. }
  1522. button:after {
  1523. border: none;
  1524. }
  1525. }
  1526. .sq-view {
  1527. padding: 60rpx 80rpx 80rpx 80rpx;
  1528. .text {
  1529. display: flex;
  1530. justify-content: center;
  1531. font-size: 32rpx;
  1532. font-weight: bold;
  1533. color: #1A1A1A;
  1534. margin-bottom: 60rpx;
  1535. }
  1536. .confirm {
  1537. display: flex;
  1538. justify-content: center;
  1539. color: white;
  1540. // margin: 40rpx auto;
  1541. background: #18254C;
  1542. border-radius: 20rpx;
  1543. }
  1544. }
  1545. .icon-text {
  1546. margin-left: 10px;
  1547. font-size: 26rpx;
  1548. font-weight: 500;
  1549. color: #323333;
  1550. }
  1551. /deep/.u-checkbox__icon-wrap.u-checkbox__icon-wrap--square {
  1552. border-color: #D7DEEB !important;
  1553. }
  1554. .wrap {
  1555. position: fixed;
  1556. top: 0;
  1557. width: 100%;
  1558. }
  1559. /deep/.mescroll-body {
  1560. min-height: 558px !important;
  1561. height: 558px !important;
  1562. background-color: green;
  1563. overflow: scroll !important;
  1564. }
  1565. .auth-btncard{
  1566. .btn-unok{
  1567. width: 50%;
  1568. float: left;
  1569. }
  1570. .btn-ok{
  1571. width: 50%;
  1572. float: left;
  1573. margin: 0;
  1574. padding: 0;
  1575. border: 0px solid transparent; //自定义边框
  1576. outline: none; //消除默认点击蓝色边框效果
  1577. u-button{
  1578. margin: 0;
  1579. padding: 0;
  1580. border: 0px solid transparent; //自定义边框
  1581. outline: none; //消除默认点击蓝色边框效果
  1582. }
  1583. }
  1584. }
  1585. .auth-card{
  1586. text-align: center;
  1587. .avatar-img{
  1588. width: 150rpx;
  1589. height: 150rpx;
  1590. overflow: hidden;
  1591. border-radius: 100%;
  1592. margin-top: 30rpx;
  1593. }
  1594. .title{
  1595. font-size: 20rpx;
  1596. }
  1597. .content{
  1598. margin-top: 10rpx;
  1599. margin-bottom: 30rpx;
  1600. }
  1601. }
  1602. .avatar-wrapper{
  1603. color: #333 !important;
  1604. border: none !important;
  1605. border-radius:0 !important;
  1606. background-color:transparent !important;
  1607. padding: 0;
  1608. }
  1609. .avatar-wrapper::after {
  1610. border: none !important;
  1611. }
  1612. .avatar{
  1613. width: 100rpx;
  1614. height: 100rpx;
  1615. overflow: hidden;
  1616. border-radius: 100%;
  1617. }
  1618. </style>