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