cardHolder.vue 45 KB

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