cardHolder.vue 45 KB

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