cardHolder.vue 45 KB

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