cardHolder.vue 45 KB

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