user-detail.php 94 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681168216831684168516861687168816891690169116921693169416951696169716981699170017011702170317041705170617071708170917101711171217131714171517161717171817191720172117221723172417251726172717281729173017311732173317341735173617371738173917401741174217431744174517461747174817491750175117521753175417551756175717581759176017611762176317641765176617671768176917701771177217731774177517761777177817791780178117821783178417851786178717881789179017911792179317941795179617971798179918001801180218031804180518061807180818091810181118121813181418151816181718181819182018211822182318241825182618271828182918301831183218331834183518361837183818391840184118421843184418451846184718481849185018511852185318541855185618571858185918601861186218631864186518661867186818691870187118721873187418751876187718781879188018811882188318841885188618871888188918901891189218931894189518961897189818991900190119021903190419051906190719081909191019111912191319141915191619171918191919201921192219231924192519261927192819291930193119321933193419351936193719381939194019411942194319441945194619471948194919501951195219531954195519561957195819591960196119621963196419651966196719681969197019711972197319741975197619771978197919801981198219831984198519861987198819891990199119921993199419951996199719981999200020012002200320042005200620072008200920102011201220132014201520162017201820192020202120222023202420252026202720282029203020312032203320342035203620372038203920402041204220432044204520462047204820492050205120522053205420552056205720582059206020612062206320642065206620672068206920702071207220732074207520762077207820792080208120822083208420852086208720882089209020912092209320942095209620972098209921002101210221032104210521062107210821092110211121122113211421152116211721182119212021212122212321242125212621272128212921302131213221332134213521362137213821392140214121422143214421452146214721482149215021512152215321542155215621572158215921602161216221632164216521662167216821692170217121722173217421752176217721782179218021812182218321842185218621872188218921902191219221932194219521962197219821992200220122022203220422052206220722082209221022112212221322142215221622172218221922202221222222232224222522262227222822292230223122322233223422352236223722382239224022412242224322442245224622472248224922502251
  1. <div id="user_detail_view" v-if="detailInfo" v-cloak>
  2. <div class="user_info">
  3. <div class="user_detail">
  4. <el-image style="height:50px;width:50px;border-radius: 50%;margin-right: 20px;" :src="detailInfo.avatar_url?detailInfo.avatar_url:'/resources/img/common/default-avatar.png'" lazy></el-image>
  5. <div style="flex:1;">
  6. <div style="margin-bottom: 20px;" class="my_flex">
  7. <div style="flex:1;">
  8. <div class="user_name">
  9. {{detailInfo.nickname}}
  10. </div>
  11. <div class="info">
  12. <div>
  13. <span>ID:</span>
  14. <span class="text">{{detailInfo.id || '无'}}</span>
  15. </div>
  16. <div>
  17. <span>来源渠道:</span>
  18. <span class="text">{{detailInfo.platform || '无'}}</span>
  19. </div>
  20. <div>
  21. <span>所有登录渠道:</span>
  22. <span class="text">{{detailInfo.all_platform|| '无'}}</span>
  23. </div>
  24. </div>
  25. </div>
  26. <div>
  27. <el-tooltip class="item" effect="light" content="清除用户微信公众号及微信小程序授权" placement="top">
  28. <el-button size="small" @click="clearAuth">清除授权</el-button>
  29. </el-tooltip>
  30. <el-button size="small" @click="promotePop">{{detailInfo.is_inviter==1?'关闭推广资格':'开启推广资格'}}</el-button>
  31. <el-button size="small" type="primary" @click="handleListOfNames">{{detailInfo.status == 0?'加入白名单':'加入黑名单'}}</el-button>
  32. </div>
  33. </div>
  34. <el-row :gutter="24" style="margin-bottom: 20px;">
  35. <el-col :span="6">手机号:{{detailInfo.mobile || '无'}}
  36. <i class="el-icon-edit" @click="upMobile"></i>
  37. <span class="title_bu_text">|</span>
  38. <span class="title_bu" style="margin-left:0;" @click="dialogVisibleTPopChangeMobile">
  39. 修改记录
  40. </span>
  41. </el-col>
  42. <el-col :span="6">注册时间:{{detailInfo.created_at | dateTimeFormat("Y-m-d H:i:s")}}</el-col>
  43. <el-col :span="6">会员等级:{{detailInfo.level || '无'}}
  44. <i class="el-icon-edit hover-close" @click="updateLevel"></i>
  45. </el-col>
  46. <el-col :span="6">来源方式:{{detailInfo.source || '无'}}</el-col>
  47. </el-row>
  48. <el-row :gutter="24" style="margin-bottom: 20px;">
  49. <el-col :span="6">最近浏览:{{detailInfo.last_login_at | dateTimeFormat("Y-m-d H:i:s") }}</el-col>
  50. <el-col :span="6">公众号:{{detailInfo.is_follow || '无'}}</el-col>
  51. <el-col :span="6">默认收货地址:{{detailInfo.address || '无'}}</el-col>
  52. <el-col :span="6">邀请码:{{detailInfo.invite_code || '无'}}</el-col>
  53. </el-row>
  54. <el-row :gutter="24" style="margin-bottom: 20px;">
  55. <el-col :span="6">
  56. <span>推荐人:{{detailInfo.parent_nickname || '无'}}</span>
  57. <i class="el-icon-edit" @click="dialogVisiblePop"></i>
  58. <span class="title_bu_text" v-if="is_show_user_relationship_log==1">|</span>
  59. <span class="title_bu" style="margin-left:0;" @click="dialogVisibleTPop" v-if="is_show_user_relationship_log==1">
  60. 修改记录
  61. </span>
  62. </el-col>
  63. <el-col :span="6">
  64. <span>修改密码:</span>
  65. <i class="el-icon-edit" @click="changePasswordPop=true"></i>
  66. </el-col>
  67. <el-col :span="6">
  68. 真实姓名:{{detailInfo.username || '无'}}
  69. <i class="el-icon-edit" @click="upUsername"></i>
  70. </el-col>
  71. <el-col :span="6">
  72. 会员过期时间:{{detailInfo.user_level_expired}}
  73. </el-col>
  74. </el-row>
  75. <el-row :gutter="24" style="margin-bottom: 20px;">
  76. <el-col :span="6">
  77. 备注:{{detailInfo.remark || '无'}}
  78. <i class="el-icon-edit" @click="upDescPop"></i>
  79. </el-col>
  80. <el-col :span="6">
  81. <span>登录设备:</span>
  82. <span>{{ getDeviceTypeText(detailInfo.device_type) }}</span>
  83. </el-col>
  84. <el-col :span="6">
  85. <span>设备MAC地址:</span>
  86. <span>{{ detailInfo.device_mac }}</span>
  87. </el-col>
  88. <el-col :span="6">
  89. <span>重置支付密码:</span>
  90. <i class="el-icon-edit" @click="paymentForm.is_reset_box_show = true"></i>
  91. </el-col>
  92. </el-row>
  93. </div>
  94. </div>
  95. </div>
  96. <!-- 会员资料 -->
  97. <div class="user_material">
  98. <div class="material_m">
  99. <div class="material_title ">
  100. <span>会员资料</span>
  101. <span class="title_bu" @click="updateUserInfoPop">编辑</span>
  102. </div>
  103. <el-row :gutter="24" style="margin-bottom: 20px;">
  104. <el-col :span="10">性别:{{detailInfo.sex_text || '-'}}</el-col>
  105. <el-col :span="8">出生年月:{{detailInfo.birthday || '-' }}</el-col>
  106. <el-col :span="6">微信号:{{detailInfo.wechat || '-'}}</el-col>
  107. </el-row>
  108. <el-row :gutter="24" style="margin-bottom: 20px;">
  109. <el-col :span="10">身份证号:{{detailInfo.id_card || '-'}}</el-col>
  110. <el-col :span="6">地区:{{detailInfo.area.province + detailInfo.area.city + detailInfo.area.area || '-'}}</el-col>
  111. </el-row>
  112. </div>
  113. <div class="material_m">
  114. <div class="material_title my_flex">
  115. <div style="flex:1;">推广身份</div>
  116. <div>
  117. <el-tooltip class="item" effect="dark" content="时间是升级身份的时间" placement="bottom">
  118. <i style="color: #BFBFBF;" class="el-icon-question"></i>
  119. </el-tooltip>
  120. </div>
  121. </div>
  122. <el-row :gutter="24" style="margin-bottom: 20px;" v-for="item in materialArr">
  123. <el-col :span="12" class="my_flex" v-for="val in item">
  124. <div style="flex: 1">{{val.name}}:{{val.level_name}}</div>
  125. <div>{{val.time}}</div>
  126. </el-col>
  127. </el-row>
  128. </div>
  129. </div>
  130. <!-- 用户资产 -->
  131. <div class="user_assets user_info">
  132. <div class="material_title">
  133. 用户资产
  134. </div>
  135. <el-row :gutter="24" style="margin-bottom: 20px;" v-for="item in propertyArr.slice(propertyPage*propertyCount,(propertyPage+1)*propertyCount)">
  136. <el-col :span="12" class="assets_ms" v-for="val in item">
  137. <div class="assets_title my_flex">
  138. <div>{{val.name}}</div>
  139. <div class="title_bu" @click="addM(val.englists,val.code)" v-if="val.englists == 'balance' || val.englists == 'score'|| val.englists == 'redpack' || val.englists == 'red_packet' || val.englists == 'currency'|| val.englists == 'digital'">
  140. <!-- {{val.englists == 'balance'?'充余额':val.englists == 'redpack'?'充红包':val.englists == 'score'?'充积分':val.englists == 'currency'?'充值'+val.name:''}}-->
  141. {{val.englists == 'balance'?'充余额':val.englists == 'redpack'?'充红包':val.englists == 'score'?'充积分':val.englists == 'currency'?'充值'+val.name:val.englists == 'digital'?'充数字币':''}}
  142. </div>
  143. <div style="flex: 1;text-align: end;" class="title_bu" @click="navDetail(val.englists,val.code)">查看明细</div>
  144. </div>
  145. <div class="my_flex assets_mo">
  146. <div class="assets_info" v-for="vv in val.list">
  147. <div>{{vv.name}}</div>
  148. <div class="info">{{vv.val}}</div>
  149. </div>
  150. </div>
  151. </el-col>
  152. </el-row>
  153. <div class="round_page">
  154. <div class="round" @click="uppropertySel(index)" :class="{page_sel: propertySel == index}" v-for="(item,index) in propertyMaxCount"></div>
  155. </div>
  156. </div>
  157. <!-- 用户标签 -->
  158. <div class="user_lable user_info" v-loading="tagLoading">
  159. <div class="material_title ">
  160. <span>用户标签</span>
  161. <span class="title_bu" @click="upTag">编辑</span>
  162. </div>
  163. <div class="my_flex">
  164. <el-tag
  165. v-for="item in detailInfo.tag"
  166. :key="item.userLabel.id"
  167. :color="item.userLabel.color"
  168. size="small"
  169. effect="dark"
  170. :closable="false"
  171. :hit="true"
  172. style="margin-left:10px"
  173. >
  174. <span>{{item.userLabel.name}} </span>
  175. <i class="hover-close el-icon-close" @click="delTag(item.label_id)"></i>
  176. </el-tag>
  177. <el-tag
  178. v-for="item in detailInfo.userMemberLabel"
  179. :key="item.id"
  180. :color="item.color"
  181. size="small"
  182. effect="dark"
  183. :closable="false"
  184. :hit="true"
  185. style="margin-left:10px"
  186. >
  187. <span>{{item.name}} </span>
  188. </el-tag>
  189. </div>
  190. </div>
  191. <!-- 社交能力 -->
  192. <div class="user_info">
  193. <div class="material_title my_flex">
  194. <div style="flex:1">社交能力</div>
  195. <div class="title_bu" style="font-size:16px;" v-if="detailInfo.is_show_my_customer" @click="navUserInfo">我的客户</div>
  196. </div>
  197. <div class="my_flex">
  198. <div v-for="(item,index) in socialityArr" class="assets_info">
  199. <div>{{item.name}}</div>
  200. <div class="info">{{item.value}}</div>
  201. </div>
  202. </div>
  203. </div>
  204. <!-- 购买能力 -->
  205. <!-- <div class="user_info">-->
  206. <!-- <div class="material_title ">-->
  207. <!-- <span>购买能力</span>-->
  208. <!-- <span class="title_bu" @click="gotoOrderIndex">累计订单</span>-->
  209. <!-- </div>-->
  210. <!-- <div class="my_flex">-->
  211. <!-- <div v-for="item in buyArr" class="assets_info">-->
  212. <!-- <div>{{item.name}}</div>-->
  213. <!-- <div class="info">{{item.value}}</div>-->
  214. <!-- </div>-->
  215. <!-- </div>-->
  216. <!-- </div>-->
  217. <!-- 兴趣爱好 -->
  218. <!-- <div class="user_info">-->
  219. <!-- <div class="material_title ">-->
  220. <!-- <span>兴趣爱好</span>-->
  221. <!-- </div>-->
  222. <!-- <el-tabs v-model="activeName" @tab-click="handleClick">-->
  223. <!-- <el-tab-pane :label="item.name" :name="item.type" v-for="item in detailInfo.interest">-->
  224. <!-- <el-table :data="item.list" stripe style="width: 100%">-->
  225. <!-- <el-table-column prop="no" label="序号" ></el-table-column>-->
  226. <!-- <el-table-column prop="name" :label="item.name + '名称'" ></el-table-column>-->
  227. <!-- <el-table-column prop="counts" label="浏览量" ></el-table-column>-->
  228. <!-- </el-table>-->
  229. <!-- </el-tab-pane>-->
  230. <!-- </el-tabs>-->
  231. <!-- </div>-->
  232. <!-- 修改上级推荐人 -->
  233. <el-dialog :close-on-click-modal="false" title="更换推荐人" :visible.sync="dialogVisible" width="50%">
  234. <el-alert title="风险警告" type="error" :closable="false" style="margin-bottom: 10px">
  235. 1.此操作有风险,如果无特别需求,不建议修改关系链。<br/>
  236. 2.修改关系链可能会导致数据不一致。<br/>
  237. 3.修改关系链不会立即生效,会根据你的提交任务排队处理。<br/>
  238. </el-alert>
  239. <el-form class="my_flex" style="margin-bottom: 10px;" v-model="searchForm" label-width="100px">
  240. <div style="width: 200px;margin-right: 10px;">
  241. <el-input size="small" v-model="searchForm.inviter_id" placeholder="请输入会员ID"></el-input>
  242. </div>
  243. <div style="width: 200px;margin-right: 10px;">
  244. <el-input size="small" v-model="searchForm.keyword" placeholder="请输入会员手机号"></el-input>
  245. </div>
  246. <el-tooltip class="item" effect="dark" content="没有推广资格的用户,搜索不出来" placement="top">
  247. <div>
  248. <el-button type="primary" size="small" @click="searchFun">查 询</el-button>
  249. </div>
  250. </el-tooltip>
  251. <div class="claer"></div>
  252. </el-form>
  253. <div style="color:#909090;">已选:{{selectUser?selectUser.nickname:''}}</div>
  254. <el-table stripe v-loading="listLoading" :data="searchInfo" style="margin-top: 5px;"
  255. @selection-change="selectionChange">
  256. <el-table-column width="100px" label="ID" props="id" align="center">
  257. <template slot-scope="props">
  258. <el-radio-group v-model="radioSelection" @change="selectionChange(props.row)">
  259. <el-radio :label="props.row.id"></el-radio>
  260. </el-radio-group>
  261. </template>
  262. </el-table-column>
  263. <el-table-column label="头像">
  264. <template slot-scope="props">
  265. <div><com-image width="40px" height="40px" mode="aspectFill" :src="props.row.avatar_url? props.row.avatar_url:'/resources/img/common/default-avatar.png'" style="border-radius: 50%;"></com-image></div>
  266. </template>
  267. </el-table-column>
  268. <el-table-column label="昵称" prop="nickname"></el-table-column>
  269. <el-table-column label="手机" prop="mobile"></el-table-column>
  270. <el-table-column label="会员等级" prop="level_name"></el-table-column>
  271. <!-- <el-table-column label="已绑定推荐人" prop="parent_name"></el-table-column>-->
  272. </el-table>
  273. <span slot="footer" class="dialog-footer">
  274. <el-button @click="dialogVisible = false">取 消</el-button>
  275. <el-button :loading="btnLoading" type="primary" @click="confirmSelectUser">确认</el-button>
  276. <el-button :loading="btnLoading" type="primary" @click="changePlatform">修改成平台</el-button>
  277. </span>
  278. </el-dialog>
  279. <!-- 修改推荐人记录 -->
  280. <el-dialog :close-on-click-modal="false" title="修改记录" :visible.sync="dialogVisibleT" width="50%">
  281. <div style="color:#909090;">
  282. <span style="margin-right: 15px;">当前绑定上级:{{referrerName}}</span>
  283. <span>ID:{{referrerId}}</span>
  284. </div>
  285. <el-table :data="referrerList" stripe style="width: 100%" v-loading="referrerLoading">
  286. <el-table-column label="变更前绑定">
  287. <template slot-scope="props">
  288. <div>{{props.row.before_id == '0'?'平台':props.row.before_name?props.row.before_name:'无'}}</div>
  289. <div style="font-size: 12px;color:#909090;">会员ID:{{props.row.before_id}}</div>
  290. </template>
  291. </el-table-column>
  292. <el-table-column label="变更后绑定">
  293. <template slot-scope="props">
  294. <div>{{props.row.after_id == '0'?'平台':props.row.after_name?props.row.after_name:'无'}}</div>
  295. <div style="font-size: 12px;color:#909090;">会员ID:{{props.row.after_id}}</div>
  296. </template>
  297. </el-table-column>
  298. <el-table-column label="变更时间" prop="updated_at"></el-table-column>
  299. </el-table>
  300. <div style="text-align: right;margin: 20px 0;">
  301. <el-pagination @current-change="referrerPagination" background layout="prev, pager, next"
  302. :page-count="referrerPageCount" :current-page="referrerPage"></el-pagination>
  303. </div>
  304. </el-dialog>
  305. <el-dialog :close-on-click-modal="false" title="修改记录" :visible.sync="dialogVisibleChangeMobile" width="50%">
  306. <el-table :data="referrerList" style="width: 100%" v-loading="referrerLoading">
  307. <el-table-column label="操作员">
  308. <template slot-scope="props">
  309. <div style="font-size: 12px;color:#909090;">{{props.row.operator}}</div>
  310. </template>
  311. </el-table-column>
  312. <el-table-column label="修改后">
  313. <template slot-scope="props">
  314. <div style="font-size: 12px;color:#909090;">{{props.row.new_mobile}}</div>
  315. </template>
  316. </el-table-column>
  317. <el-table-column label="修改前">
  318. <template slot-scope="props">
  319. <div style="font-size: 12px;color:#909090;">{{props.row.old_mobile}}</div>
  320. </template>
  321. </el-table-column>
  322. <el-table-column label="变更时间" prop="created_at"></el-table-column>
  323. </el-table>
  324. <div style="text-align: right;margin: 20px 0;">
  325. <el-pagination @current-change="referrerPagination" background layout="prev, pager, next"
  326. :page-count="referrerPageCount" :current-page="referrerPage"></el-pagination>
  327. </div>
  328. </el-dialog>
  329. <!-- 修改备注 -->
  330. <el-dialog :close-on-click-modal="false" title="修改备注" :visible.sync="userDescPop" width="50%">
  331. <el-input v-model="newDesc" placeholder="请输入你要备注的内容"></el-input>
  332. <span slot="footer" class="dialog-footer">
  333. <el-button @click="userDescPop = false">取 消</el-button>
  334. <el-button :loading="btnLoading" type="primary" @click="updateDesc">确认</el-button>
  335. </span>
  336. </el-dialog>
  337. <!-- 修改真实姓名 -->
  338. <el-dialog :close-on-click-modal="false" title="修改真实姓名" :visible.sync="usernamePop" width="50%">
  339. <el-input v-model="username" placeholder="请输入真实姓名"></el-input>
  340. <span slot="footer" class="dialog-footer">
  341. <el-button @click="usernamePop = false">取 消</el-button>
  342. <el-button :loading="btnLoading" type="primary" @click="updateUsername">确认</el-button>
  343. </span>
  344. </el-dialog>
  345. <el-dialog :close-on-click-modal="false" title="修改手机号码" :visible.sync="descPop" width="50%">
  346. <el-input v-model="mobile" placeholder="请输入手机号码"></el-input>
  347. <span slot="footer" class="dialog-footer">
  348. <el-button @click="descPop = false">取 消</el-button>
  349. <el-button :loading="btnLoading" type="primary" @click="updateMobile">确认</el-button>
  350. </span>
  351. </el-dialog>
  352. <!-- 修改会员资料 -->
  353. <el-dialog :close-on-click-modal="false" title="编辑基本信息" :visible.sync="userInfoPop" width="50%">
  354. <el-form ref="form" :model="userForm" label-width="100px" ref="integralForm">
  355. <el-form-item label="性别:" prop="sex">
  356. <div style="width: 200px;">
  357. <el-select v-model="userForm.sex" placeholder="请选择性别">
  358. <el-option label="男" value="1"></el-option>
  359. <el-option label="女" value="2"></el-option>
  360. </el-select>
  361. </div>
  362. </el-form-item>
  363. <el-form-item label="出生年月:">
  364. <div style="width: 200px;">
  365. <el-date-picker value-format="yyyy-MM-dd" type="date" placeholder="选择日期" v-model="userForm.birthday" style="width: 100%;"></el-date-picker>
  366. </div>
  367. </el-form-item>
  368. <el-form-item label="微信号:">
  369. <div style="width: 200px;">
  370. <el-input v-model="userForm.wechat" placeholder="请输入微信号"></el-input>
  371. </div>
  372. </el-form-item>
  373. <el-form-item label="地区:">
  374. <div class="my_flex up_user_s">
  375. <!-- <el-select v-model="userForm.province_id" placeholder="省" @change="upAddrs">-->
  376. <!-- <el-option :label="item.name" :value="item.id" v-for="item in addrs" :key="item.id"></el-option>-->
  377. <!-- </el-select>-->
  378. <!-- <el-select v-model="userForm.city_id" placeholder="市" @change="upCity">-->
  379. <!-- <el-option :label="item.name" :value="item.id" v-for="item in cityArr" :key="item.id"></el-option>-->
  380. <!-- </el-select>-->
  381. <!-- <el-select v-model="userForm.area_id" placeholder="区">-->
  382. <!-- <el-option :label="item.name" :value="item.id" v-for="item in areaArr" :key="item.id"></el-option>-->
  383. <!-- </el-select>-->
  384. <el-select v-model="regionArr[0]" size="small" placeholder="请选择" @change="getCity">
  385. <el-option v-for="item in province" :key="item.id" :label="item.name" :value="item.name"></el-option>
  386. </el-select>
  387. <el-select v-model="regionArr[1]" size="small" placeholder="请选择" @change="getDistrict">
  388. <el-option v-for="item in city" :key="item.id" :label="item.name" :value="item.name"></el-option>
  389. </el-select>
  390. <el-select v-model="regionArr[2]" size="small" placeholder="请选择" @change="getArea">
  391. <el-option v-for="item in district" :key="item.id" :label="item.name" :value="item.name"></el-option>
  392. </el-select>
  393. </div>
  394. </el-form-item>
  395. <el-form-item label="身份证号码:">
  396. <div style="width: 200px;">
  397. <el-input v-model="userForm.id_card" placeholder="请输入身份证号码"></el-input>
  398. </div>
  399. </el-form-item>
  400. </el-form>
  401. <span slot="footer" class="dialog-footer">
  402. <el-button @click="userInfoPop = false">取 消</el-button>
  403. <el-button :loading="btnLoading" type="primary" @click="updateUserInfo">确认</el-button>
  404. </span>
  405. </el-dialog>
  406. <!-- 充值余额 -->
  407. <el-dialog :close-on-click-modal="false" :title="hintBoo?'提示':'充值余额'" :visible.sync="dialogBalance" width="30%" @close="closePop">
  408. <div v-if="hintBoo">
  409. 选择清空余额,是否还要继续
  410. </div>
  411. <el-form v-else :model="balanceForm" label-width="80px" :rules="balanceFormRules" ref="integralForm">
  412. <el-form-item label="余额数量" prop="price" size="small">
  413. <el-input type="number" v-model="balanceForm.price" placeholder="请输入要加/减的余额(-1代表减1余额)"></el-input>
  414. </el-form-item>
  415. <el-form-item label="备注" prop="remark" size="small">
  416. <el-input v-model="balanceForm.remark"></el-input>
  417. </el-form-item>
  418. </el-form>
  419. <div slot="footer" class="dialog-footer">
  420. <el-button @click="dialogBalance = false">取消</el-button>
  421. <el-button :loading="btnLoading" type="primary" @click="balanceSubmit">确定</el-button>
  422. </div>
  423. </el-dialog>
  424. <!-- 充值积分 -->
  425. <el-dialog :close-on-click-modal="false" :title="hintBoo?'提示':'充值积分'" :visible.sync="dialogIntegral" width="30%" @close="closePop">
  426. <div v-if="hintBoo">
  427. 选择清空积分,是否还要继续
  428. </div>
  429. <el-form v-else :model="integralForm" label-width="80px" :rules="integralFormRules" ref="integralForm">
  430. <el-form-item label="积分数量" prop="num" size="small">
  431. <el-input type="number" v-model="integralForm.num" placeholder="请输入要加/减的积分值(-1代表减1积分)"></el-input>
  432. </el-form-item>
  433. <el-form-item label="备注" prop="remark" size="small">
  434. <el-input v-model="integralForm.remark" placeholder="备注原因"></el-input>
  435. </el-form-item>
  436. </el-form>
  437. <div slot="footer" class="dialog-footer">
  438. <el-button @click="dialogIntegral = false">取消</el-button>
  439. <el-button :loading="btnLoading" type="primary" @click="integralSubmit">确定</el-button>
  440. </div>
  441. </el-dialog>
  442. <!-- 货币充值 -->
  443. <el-dialog :close-on-click-modal="false" title="货币充值" :visible.sync="currencyBoo" width="30%">
  444. <el-form :model="currencyForm" label-width="80px" :rules="currencyFormRules" ref="integralForm">
  445. <el-form-item label="货币数量" prop="money" size="small">
  446. <el-input type="number" v-model="currencyForm.money" placeholder="请输入要加/减的货币值(-1代表减1货币)"></el-input>
  447. </el-form-item>
  448. <el-form-item label="备注" prop="desc" size="small">
  449. <el-input v-model="currencyForm.desc"></el-input>
  450. </el-form-item>
  451. </el-form>
  452. <div slot="footer" class="dialog-footer">
  453. <el-button @click="currencyBoo = false">取消</el-button>
  454. <el-button :loading="btnLoading" type="primary" @click="currencySubmit">确定</el-button>
  455. </div>
  456. </el-dialog>
  457. <!-- 加标签 -->
  458. <el-dialog :close-on-click-modal="false" title="编辑标签" :visible.sync="labelBoo" width="30%">
  459. <el-select
  460. v-model="lableValue"
  461. multiple
  462. filterable
  463. allow-create
  464. default-first-option
  465. placeholder="请选择会员标签"
  466. >
  467. <el-option
  468. v-for="item in userTagList"
  469. :key="item.tag_id"
  470. :label="item.name"
  471. :value="item.tag_id">
  472. </el-option>
  473. </el-select>
  474. <div slot="footer" class="dialog-footer">
  475. <el-button v-loading="tagLoading" @click="labelBoo = false">取消</el-button>
  476. <el-button :loading="btnLoading" v-loading="tagLoading" type="primary" @click="labelSubmit">确定</el-button>
  477. </div>
  478. </el-dialog>
  479. <!-- 编辑会员等级 -->
  480. <el-dialog :close-on-click-modal="false" title="修改会员等级" :visible.sync="userRankPop" width="30%">
  481. <el-form label-position="right" label-width="80px">
  482. <el-form-item label="等级名称">
  483. <el-select v-model="selUserRank" placeholder="请选择会员等级">
  484. <el-option :label="default_level_name" value="0"></el-option>
  485. <el-option
  486. v-for="(item,index) in detailInfo.user_level_list"
  487. :key="index"
  488. :label="item"
  489. :value="index">
  490. </el-option>
  491. </el-select>
  492. </el-form-item>
  493. </el-form>
  494. <span slot="footer" class="dialog-footer">
  495. <el-button @click="userRankPop = false">取 消</el-button>
  496. <el-button :loading="btnLoading" type="primary" @click="updateRank">确认</el-button>
  497. </span>
  498. </el-dialog>
  499. <!-- 修改密码 -->
  500. <el-dialog :close-on-click-modal="false" title="修改密码" :visible.sync="changePasswordPop" width="30%">
  501. <el-form label-position="right" @submit.native.prevent label-width="80px">
  502. <el-form-item label="密码">
  503. <el-input placeholder="请输入密码" v-model="change_password" @keyup.enter.native="changePasswordSubmit" show-password></el-input>
  504. </el-form-item>
  505. </el-form>
  506. <div slot="footer" class="dialog-footer">
  507. <el-button @click="changePasswordPop = false">取消</el-button>
  508. <el-button :loading="btnLoading" type="primary" @click="changePasswordSubmit">确定</el-button>
  509. </div>
  510. </el-dialog>
  511. <!-- 加入黑白名单 -->
  512. <el-dialog :close-on-click-modal="false" title="提示" :visible.sync="listOfNamesBoo" width="30%">
  513. <div>
  514. {{balanceForm.status == 1?'您确认加入黑名单吗':'您确认加入白名单吗'}}
  515. </div>
  516. <div style="line-height: 30px;color: #FA6565;" v-if="balanceForm.status == 1">
  517. 拉黑后,该账号将无法访问商城
  518. </div>
  519. <div slot="footer" class="dialog-footer">
  520. <el-button @click="listOfNamesBoo = false">取消</el-button>
  521. <el-button :loading="btnLoading" :loading="btnLoading" type="primary" @click="listOfNamesBooSubmit">确定</el-button>
  522. </div>
  523. </el-dialog>
  524. <!-- 红包充值 -->
  525. <el-dialog :close-on-click-modal="false" :title="hintBoo?'提示':'红包充值'" :visible.sync="dialogRedpack" width="30%" @close="closePop">
  526. <div v-if="hintBoo">
  527. 选择清空余额,是否还要继续
  528. </div>
  529. <el-form v-else :model="redpackForm" label-width="80px" :rules="redpackFormRules" ref="integralForm">
  530. <el-form-item label="红包金额" prop="redpack_money" size="small">
  531. <el-input onInput="value = toNumber(value, 2, true)" v-model="redpackForm.redpack_money" placeholder="请输入要加/减的余额(-1代表减1余额)"></el-input>
  532. </el-form-item>
  533. <el-form-item label="红包类型" prop="redpack_type" size="small">
  534. <el-radio-group v-model="redpackForm.redpack_type">
  535. <el-radio label="frozen_redpack">冻结红包</el-radio>
  536. <el-radio label="redpack">激活红包</el-radio>
  537. </el-radio-group>
  538. </el-form-item>
  539. <el-form-item label="备注" prop="remark" size="small">
  540. <el-input v-model="redpackForm.remark"></el-input>
  541. </el-form-item>
  542. </el-form>
  543. <div slot="footer" class="dialog-footer">
  544. <el-button @click="dialogRedpack = false">取消</el-button>
  545. <el-button :loading="btnLoading" type="primary" @click="redpackSubmit">确定</el-button>
  546. </div>
  547. </el-dialog>
  548. <!-- 是否开启推广资格 -->
  549. <el-dialog :close-on-click-modal="false" title="提示" :visible.sync="promoteBoo" width="30%">
  550. <div>
  551. {{detailInfo.is_inviter==1?'关闭后该会员无法绑定下级,是否确认关闭':'是否开启推广资格'}}
  552. </div>
  553. <div slot="footer" class="dialog-footer">
  554. <el-button @click="promoteBoo = false">取消</el-button>
  555. <el-button :loading="btnLoading" type="primary" @click="promoteSubmit">确定</el-button>
  556. </div>
  557. </el-dialog>
  558. <!-- 优惠券 -->
  559. <el-dialog :close-on-click-modal="false" title="优惠券" :visible.sync="couponBoo" width="50%">
  560. <el-radio-group v-model="couponListType" size="mini" @input="couponListTypeChange">
  561. <el-radio-button label="1">商城平台</el-radio-button>
  562. <el-radio-button label="2">o2o门店</el-radio-button>
  563. </el-radio-group>
  564. <el-tabs v-model="couponSel" @tab-click="couponClick">
  565. <el-tab-pane :label="item.name" :name="item.type" v-for="item in couponType">
  566. <el-table :data="couponListData" stripe style="width: 100%" v-loading="couponLoading">
  567. <el-table-column key='1' type="index" prop="name" label="序号" ></el-table-column>
  568. <el-table-column key='1' prop="name" label="优惠券名称" ></el-table-column>
  569. <el-table-column key='2' prop="get_time" label="领取时间" >
  570. <template slot-scope="scope">{{scope.row.get_time | dateTimeFormat("Y-m-d H:i:s")}}</template>
  571. </el-table-column>
  572. <el-table-column key='2' prop="end_time" label="到期时间" >
  573. <template slot-scope="scope">{{scope.row.end_time | dateTimeFormat("Y-m-d H:i:s")}}</template>
  574. </el-table-column>
  575. </el-table>
  576. <div style="text-align: right;margin: 20px 0;">
  577. <el-pagination
  578. @current-change="upCouponPage"
  579. background
  580. layout="prev, pager, next"
  581. :page-count="couponPageCount"
  582. :current-page.sync="couponPage"
  583. ></el-pagination>
  584. </div>
  585. </el-tab-pane>
  586. </el-tabs>
  587. <el-dialog :close-on-click-modal="false" width="30%" title="提示" :visible.sync="delPop" append-to-body>
  588. <div>你确定是否删除</div>
  589. <div slot="footer" class="dialog-footer">
  590. <el-button @click="delPop = false">取消</el-button>
  591. <el-button :loading="btnLoading" :loading="btnLoading" type="primary" @click="delSub(1)">确定</el-button>
  592. </div>
  593. </el-dialog>
  594. </el-dialog>
  595. <!-- 电子卷 -->
  596. <el-dialog :close-on-click-modal="false" title="电子卷" :visible.sync="e_couponBoo" width="50%">
  597. <el-tabs v-model="e_couponSel" @tab-click="e_couponClick">
  598. <el-tab-pane :label="item.name" :name="item.type" v-for="item in e_couponType">
  599. <el-table :data="e_couponList" stripe style="width: 100%" v-loading="e_couponLoading">
  600. <el-table-column key='1' prop="e_coupon_name" label="优惠券名称"></el-table-column>
  601. <el-table-column key='2' prop="created_at" :label="e_couponSel == '2'?'激活时间':e_couponSel == '3'?'兑换时间':'领取时间'" ></el-table-column>
  602. <el-table-column key='3' prop="expired_time" label="到期时间" v-if="e_couponSel == 1 || e_couponSel == 2 || e_couponSel == 4"></el-table-column>
  603. <el-table-column key='4' prop="status" label="状态" v-if="e_couponSel == 2"></el-table-column>
  604. <el-table-column key='5' prop="price" label="激活金额" v-if="e_couponSel == 1 || e_couponSel == 2"></el-table-column>
  605. <el-table-column key='6' prop="receive_amount" label="数量" v-if="e_couponSel == 1 || e_couponSel == 2"></el-table-column>
  606. <el-table-column key='7' label="操作" v-if="e_couponSel == '1'">
  607. <template slot-scope="scope">
  608. <el-button type="text" @click="delCoupon(scope.row.id)">删除</el-button>
  609. </template>
  610. </el-table-column>
  611. </el-table>
  612. <div style="text-align: right;margin: 20px 0;">
  613. <el-pagination @current-change="upECouponPage" background layout="prev, pager, next"
  614. :page-count="ecouponPageCount" :current-page="ecouponPage"></el-pagination>
  615. </div>
  616. </el-tab-pane>
  617. </el-tabs>
  618. <el-dialog :close-on-click-modal="false" width="30%" title="提示" :visible.sync="delPop" append-to-body>
  619. <div>你确定是否删除</div>
  620. <div slot="footer" class="dialog-footer">
  621. <el-button @click="delPop = false">取消</el-button>
  622. <el-button :loading="btnLoading" :loading="btnLoading" type="primary" @click="delSub(2)">确定</el-button>
  623. </div>
  624. </el-dialog>
  625. </el-dialog>
  626. <!--重置支付密码-->
  627. <el-dialog :close-on-click-modal="false" title="重置支付密码" :visible.sync="paymentForm.is_reset_box_show" :before-close="clearResetPayment" width="30%">
  628. <el-form label-position="right" :model="paymentForm" :rules="paymentResetRules" ref="paymentForm" label-width="80px">
  629. <el-form-item label="密码" prop="password">
  630. <el-input placeholder="请输入密码" v-model="paymentForm.password" show-password></el-input>
  631. </el-form-item>
  632. <el-form-item label="确认密码" prop="ack_password" required>
  633. <el-input placeholder="请输入确认密码" v-model="paymentForm.ack_password" show-password></el-input>
  634. </el-form-item>
  635. </el-form>
  636. <div slot="footer" class="dialog-footer">
  637. <el-button @click="clearResetPayment">取消</el-button>
  638. <el-button :loading="btnLoading" type="primary" @click="resetPaymentPasswordSubmit">确定</el-button>
  639. </div>
  640. </el-dialog>
  641. <!-- 充值数字币 -->
  642. <el-dialog :close-on-click-modal="false" :title="hintBoo?'提示':'充值数字币'" :visible.sync="dialogDigital" width="30%" @close="closePop">
  643. <el-form :model="digitalForm" label-width="80px" :rules="digitalFormRules" ref="dialogForm">
  644. <el-form-item label="数字币数量" prop="price" size="small">
  645. <el-input type="number" v-model="digitalForm.price" placeholder="请输入要加/减的数字币(-1代表减1余额)"></el-input>
  646. </el-form-item>
  647. <el-form-item label="备注" prop="remark" size="small">
  648. <el-input v-model="digitalForm.remark"></el-input>
  649. </el-form-item>
  650. </el-form>
  651. <div slot="footer" class="dialog-footer">
  652. <el-button @click="dialogDigital = false">取消</el-button>
  653. <el-button :loading="btnLoading" type="primary" @click="digitalSubmit">确定</el-button>
  654. </div>
  655. </el-dialog>
  656. </div>
  657. <script>
  658. // getQuery('order_id'),
  659. const app = new Vue({
  660. el: '#user_detail_view',
  661. data() {
  662. return {
  663. user_id: 0,
  664. detailInfo: null,
  665. materialArr: [],
  666. paymentForm: {
  667. password: '',
  668. ack_password: '',
  669. is_reset_box_show: false
  670. },
  671. paymentResetRules: {
  672. password: [
  673. { required: true, message: '请输入密码', trigger: 'blur' },
  674. { min: 6,max: 6, message: '支付密码只能为六位字符', trigger: 'blur' },
  675. { pattern: /^[0-9]*$/, message: '支付密码必须为数字', trigger: 'blur' },
  676. ],
  677. ack_password: [
  678. { validator: this.paymentAckPassword, trigger: 'blur' },
  679. ],
  680. },
  681. socialityArr: [
  682. {
  683. type: 'team_count',
  684. name: '团队人数',
  685. value: '0'
  686. },{
  687. type: 'first',
  688. name: '好友人数',
  689. value: '0'
  690. },{
  691. type: 'second',
  692. name: '粉丝人数',
  693. value: '0'
  694. }
  695. ],
  696. buyArr: [
  697. {
  698. type: 'total_price',
  699. name: '累计消费金额(元)',
  700. value: '0',
  701. v_type: 'double'
  702. },{
  703. type: 'total_orders',
  704. name: '累计消费订单数',
  705. value: '0',
  706. v_type: 'num'
  707. },{
  708. type: 'unit_price',
  709. name: '客单价(元)',
  710. value: '0',
  711. v_type: 'double'
  712. },{
  713. type: 'last_time',
  714. name: '最近下单时间',
  715. value: '-',
  716. v_type: 'time'
  717. },{
  718. type: 'total_refund_price',
  719. name: '累计退款金额(元)',
  720. value: '0',
  721. v_type: 'double'
  722. },{
  723. type: 'total_refund_orders',
  724. name: '累计退款订单数',
  725. value: '0',
  726. v_type: 'num'
  727. },
  728. ],
  729. propertyArr:[],
  730. activeName: '',
  731. propertyPage: 0,
  732. propertyCount: 2,
  733. propertyMaxCount: 1,
  734. propertySel: 0,
  735. searchForm: {
  736. inviter_id: '',
  737. keyword: '',
  738. },
  739. dialogVisible: false,//修改推荐人弹窗
  740. searchInfo: [],//修改推荐人搜索出来的内容
  741. listLoading: false,
  742. radioSelection: 0,//选中用户ID
  743. selectUser: null, //选中的用户
  744. dialogVisibleT: false,//修改记录弹窗
  745. dialogVisibleChangeMobile: false,//修改记录弹窗
  746. referrerList: [],//推荐人记录
  747. referrerName: '',
  748. referrerId: '',
  749. referrerLoading: false,
  750. referrerPage: 1,
  751. referrerPageCount: 0,
  752. descPop: false, //备注弹框
  753. usernamePop: false, //修改用户名
  754. userDescPop: false, //备注弹框
  755. newDesc: '',//备注内容
  756. userForm: { //修改会员资料
  757. sex: '',
  758. birthday: '',
  759. wechat: '',
  760. province: '',
  761. city: '',
  762. area: '',
  763. id_card: '',
  764. province_id: '',
  765. city_id: '',
  766. area_id: '',
  767. },
  768. userInfoPop: false,//修改会员资料弹窗
  769. regionArr: [],
  770. province: [],//省市区列表
  771. city: [],//市列表
  772. district: [],//区列表
  773. dialogBalance: false,
  774. balanceForm: {
  775. type: '1',
  776. price: '',
  777. pic_url: '',
  778. remark: '',
  779. },
  780. balanceFormRules: {
  781. price: [
  782. {required: true, message: '金额不能为空', trigger: 'blur'},
  783. ],
  784. // remark: [
  785. // {required: true, message: '备注不能为空', trigger: 'blur'},
  786. // ]
  787. },
  788. hintBoo: false,
  789. integralOrBalanceType: 1, //积分或余额充值状态,1:加或减 2:标识清零
  790. btnLoading: false,
  791. //积分
  792. dialogIntegral: false,
  793. integralForm: {
  794. type: '1',
  795. num: '',
  796. pic_url: '',
  797. remark: '',
  798. },
  799. integralFormRules: {
  800. num: [
  801. {required: true, message: '积分数量不能为空', trigger: 'blur'},
  802. ],
  803. // remark: [
  804. // {required: true, message: '备注不能为空', trigger: 'blur'},
  805. // ]
  806. },
  807. // 货币
  808. currencyBoo: false,
  809. currencyFormRules: {
  810. money: [
  811. {required: true, message: '货币数量不能为空', trigger: 'blur'},
  812. ],
  813. desc: [
  814. {required: true, message: '备注不能为空', trigger: 'blur'},
  815. ],
  816. code: [
  817. {required: true, message: '货币类型不能为空', trigger: 'blur'},
  818. ]
  819. },
  820. currencyForm: {
  821. type: '1',
  822. code:'',
  823. money: '',
  824. desc: '',
  825. },
  826. currencyList: [],
  827. specifyCurrency: false,//是否指定货币充值
  828. // 标签
  829. labelBoo: false,
  830. lableValue: [],
  831. userTagList: [],//会员标签列表
  832. // 黑白名单
  833. listOfNamesBoo: false,
  834. // 推广资格
  835. promoteBoo: false,
  836. // 修改密码
  837. changePasswordPop: false,
  838. change_password: null,
  839. // 优惠卷
  840. couponBoo: false,
  841. couponSel: '2',
  842. couponType: [
  843. {
  844. name: '可使用',
  845. type: '2'
  846. },
  847. {
  848. name: '已使用',
  849. type: '1'
  850. },
  851. {
  852. name: '已过期',
  853. type: '3'
  854. },
  855. {
  856. name: '已失效',
  857. type: '4'
  858. }
  859. ],
  860. couponList: [],
  861. couponListData: [],
  862. couponListType: '1', // 优惠券列表类型
  863. couponLoading: false,
  864. couponPage: 1,
  865. couponPageCount: 0,
  866. // 电子卷
  867. e_couponBoo: false,
  868. e_couponSel: '1',
  869. e_couponType: [{
  870. name: '未激活',
  871. type: '1'
  872. },{
  873. name: '已激活',
  874. type: '2'
  875. },{
  876. name: '已兑换',
  877. type: '3'
  878. },{
  879. name: '未激活',
  880. type: '4'
  881. }],
  882. e_couponList: [],
  883. e_couponLoading: false,
  884. ecouponPage: 1,
  885. ecouponPageCount: 0,
  886. // 删除卷弹窗
  887. delPop: false,
  888. delId: 0,//删除ID
  889. userRankPop: false, //编辑会员等级
  890. tagLoading: false,
  891. //红包
  892. dialogRedpack: false,
  893. redpackForm: {
  894. redpack_type: "frozen_redpack",
  895. redpack_money: '',
  896. user_id:'',
  897. remark: '',
  898. },
  899. redpackFormRules: {
  900. redpack_money: [
  901. {required: true, message: '红包金额不能为空', trigger: 'blur'},
  902. ],
  903. },
  904. redpack_type:[],//红包类型
  905. selUserRank:'',
  906. username:'',
  907. mobile:'',
  908. default_level_name: '普通会员',
  909. is_show_user_relationship_log:0,
  910. dialogDigital:false,
  911. digitalForm: {
  912. user_id:'',
  913. price: '',
  914. remark: '',
  915. },
  916. digitalFormRules: {
  917. price: [
  918. {required: true, message: '数字币数量不能为空', trigger: 'blur'},
  919. ],
  920. // remark: [
  921. // {required: true, message: '备注不能为空', trigger: 'blur'},
  922. // ]
  923. },
  924. }
  925. },
  926. mounted(){
  927. this.user_id = getQuery('id');
  928. this.getList();
  929. this.getTagList();
  930. // this.getCurrencyList();
  931. },
  932. methods:{
  933. getList(){
  934. let that = this;
  935. request({
  936. params: {
  937. r: 'mall/user/user-detail',
  938. id: this.user_id
  939. },
  940. method: 'get'
  941. }).then(res => {
  942. if(res.data.code == 0){
  943. this.propertyArr = [];
  944. this.detailInfo = res.data.data.detail;
  945. this.is_show_user_relationship_log = res.data.data.is_show_user_relationship_log;
  946. let arr = [];
  947. this.detailInfo.user_promote_identity.forEach((v,i) => {
  948. arr.push(v);
  949. // if((i+1) % 2 == 0){
  950. that.materialArr.push(arr);
  951. arr = [];
  952. // }
  953. })
  954. let arrTwo = [];
  955. this.detailInfo.user_property.forEach((v,i) => {
  956. arrTwo.push(v);
  957. if((i+1) % 2 == 0){
  958. that.propertyArr.push(arrTwo);
  959. arrTwo = [];
  960. } else if(i+1 == this.detailInfo.user_property.length){
  961. that.propertyArr.push(arrTwo);
  962. arrTwo = [];
  963. }
  964. })
  965. // debugger;
  966. this.propertyMaxCount = Math.ceil(this.propertyArr.length / this.propertyCount);
  967. // console.info(this.propertyMaxCount);
  968. for (const key in this.detailInfo.team) {
  969. let info = this.socialityArr.filter(v => v.type == key); //订单概况
  970. if(info.length){
  971. let index = this.socialityArr.findIndex(v => v.type==info[0].type);
  972. this.socialityArr[index].value = this.detailInfo.team[key];
  973. }
  974. }
  975. for (const key in this.detailInfo.buy_power) {
  976. let info = this.buyArr.filter(v => v.type == key); //订单概况
  977. if(info.length){
  978. let index = this.buyArr.findIndex(v => v.type==info[0].type);
  979. this.buyArr[index].value = this.detailInfo.buy_power[key];
  980. }
  981. }
  982. if(this.detailInfo.interest.length){
  983. this.activeName = this.detailInfo.interest[0].type;
  984. }
  985. console.log(this.propertyArr,555);
  986. this.checkedAll = false;
  987. this.default_level_name = res.data.data.default_level_name;
  988. }else{
  989. this.$message.error(res.data.msg);
  990. }
  991. this.tagLoading = false;
  992. }).catch(err => {
  993. })
  994. },
  995. uppropertySel(index){
  996. if(this.propertySel == index) return;
  997. this.propertyPage = index;
  998. this.propertySel = index;
  999. },
  1000. handleClick(tab, event){
  1001. },
  1002. // 搜索
  1003. searchFun(){
  1004. if (!this.searchForm.inviter_id && !this.searchForm.keyword){
  1005. this.$message.error('查询内容不能为空');
  1006. this.listLoading = false;
  1007. return false;
  1008. }
  1009. this.listLoading = true;
  1010. request({
  1011. params: {
  1012. r: 'mall/user/get-can-bind-inviter',
  1013. inviter_id: this.searchForm.inviter_id,
  1014. keyword: this.searchForm.keyword,
  1015. user_id: this.user_id,
  1016. },
  1017. }).then(e => {
  1018. this.listLoading = false;
  1019. if (e.data.code === 0) {
  1020. this.searchInfo = e.data.data.list.list;
  1021. } else {
  1022. this.$message.error(res.data.msg);
  1023. }
  1024. }).catch(e => {
  1025. this.listLoading = false;
  1026. });
  1027. },
  1028. // 打开修改推荐人窗口
  1029. dialogVisiblePop(){
  1030. this.searchForm = {
  1031. inviter_id: '',
  1032. keyword: '',
  1033. }
  1034. this.searchInfo.splice(0,this.searchInfo.length);
  1035. this.radioSelection = 0;
  1036. this.selectUser = null;
  1037. this.dialogVisible = true;
  1038. },
  1039. // 修改推荐人
  1040. confirmSelectUser(){
  1041. this.$confirm('是否修改推荐人?', '警告', {type: 'warning'}).then(() => {
  1042. this.btnLoading = true;
  1043. request({
  1044. params: {
  1045. r: 'mall/user/update-parent'
  1046. },
  1047. method: 'post',
  1048. data: {
  1049. user_id: this.user_id,
  1050. parent_id: this.radioSelection
  1051. }
  1052. }).then(res => {
  1053. if (res.data.code == 0) {
  1054. this.$message.success(res.data.msg);
  1055. } else {
  1056. this.$message.error(res.data.msg);
  1057. }
  1058. this.dialogVisible = false;
  1059. this.btnLoading = false;
  1060. }).catch(err => {
  1061. console.info(err);
  1062. this.btnLoading = false;
  1063. this.dialogVisible = false;
  1064. })
  1065. });
  1066. },
  1067. changePlatform(){
  1068. this.$confirm('是否把推荐人修改成平台?', '警告', {type: 'warning'}).then(() => {
  1069. this.btnLoading = true;
  1070. request({
  1071. params: {
  1072. r: 'mall/user/update-parent'
  1073. },
  1074. method: 'post',
  1075. data: {
  1076. user_id: this.user_id,
  1077. parent_id: 0
  1078. }
  1079. }).then(res => {
  1080. if (res.data.code == 0) {
  1081. this.$message.success(res.data.msg);
  1082. } else {
  1083. this.$message.error(res.data.msg);
  1084. }
  1085. this.dialogVisible = false;
  1086. this.btnLoading = false;
  1087. }).catch(err => {
  1088. console.info(err);
  1089. this.btnLoading = false;
  1090. this.dialogVisible = false;
  1091. })
  1092. });
  1093. },
  1094. selectionChange(e){
  1095. this.selectUser = e;
  1096. },
  1097. dialogVisibleTPopChangeMobile(){
  1098. this.dialogVisibleChangeMobile = true;
  1099. this.getChangeMobileList();
  1100. },
  1101. getChangeMobileList(){
  1102. this.referrerLoading = true;
  1103. request({
  1104. params: {
  1105. r: 'mall/user/get-change-mobile-log',
  1106. user_id: this.user_id
  1107. },
  1108. method: 'get'
  1109. }).then(res => {
  1110. if(res.data.code == 0){
  1111. this.referrerList = res.data.data.list;
  1112. this.referrerPageCount = res.data.data.page_count;
  1113. } else {
  1114. this.$message.error(res.data.msg);
  1115. }
  1116. this.referrerLoading = false;
  1117. }).catch(err => {
  1118. console.info(err);
  1119. this.referrerLoading = false;
  1120. })
  1121. },
  1122. // 打开推荐人记录窗口
  1123. dialogVisibleTPop(){
  1124. this.dialogVisibleT = true;
  1125. this.getReferrerList();
  1126. },
  1127. getReferrerList(){
  1128. this.referrerLoading = true;
  1129. request({
  1130. params: {
  1131. r: 'mall/user/user-change-parent-log',
  1132. user_id: this.user_id
  1133. },
  1134. method: 'get'
  1135. }).then(res => {
  1136. if(res.data.code == 0){
  1137. this.referrerList = res.data.data.list;
  1138. this.referrerName = res.data.data.parent_nickname;
  1139. this.referrerId = res.data.data.parent_id;
  1140. this.referrerPageCount = res.data.data.page_count;
  1141. } else {
  1142. this.$message.error(res.data.msg);
  1143. }
  1144. this.referrerLoading = false;
  1145. }).catch(err => {
  1146. console.info(err);
  1147. this.referrerLoading = false;
  1148. })
  1149. },
  1150. // 推荐人记录分页
  1151. referrerPagination(currentPage){
  1152. this.referrerPage = currentPage;
  1153. this.getReferrerList();
  1154. },
  1155. // 备注弹框
  1156. upDescPop(){
  1157. this.newDesc = this.detailInfo.remark;
  1158. this.userDescPop = true;
  1159. },
  1160. upUsername(){
  1161. this.username = this.detailInfo.username;
  1162. this.usernamePop = true;
  1163. },
  1164. upMobile(){
  1165. this.descPop = true;
  1166. },
  1167. // 修改备注
  1168. updateDesc(){
  1169. this.btnLoading = true;
  1170. request({
  1171. params: {
  1172. r: 'mall/user/edit-remark'
  1173. },
  1174. method: 'post',
  1175. data: {
  1176. remark: this.newDesc,
  1177. user_id: this.user_id
  1178. }
  1179. }).then(res => {
  1180. if(res.data.code == 0){
  1181. this.$message.success(res.data.msg);
  1182. this.detailInfo.remark = this.newDesc;
  1183. } else{
  1184. this.$message.error(res.data.msg);
  1185. }
  1186. this.btnLoading = false;
  1187. this.userDescPop = false;
  1188. }).catch(err => {
  1189. this.btnLoading = false;
  1190. this.userDescPop = false;
  1191. })
  1192. },
  1193. updateUsername(){
  1194. this.btnLoading = true;
  1195. request({
  1196. params: {
  1197. r: 'mall/user/edit-username'
  1198. },
  1199. method: 'post',
  1200. data: {
  1201. username: this.username,
  1202. user_id: this.user_id
  1203. }
  1204. }).then(res => {
  1205. if(res.data.code == 0){
  1206. this.$message.success(res.data.msg);
  1207. this.detailInfo.username = this.username;
  1208. this.usernamePop = false;
  1209. } else{
  1210. this.$message.error(res.data.msg);
  1211. }
  1212. this.btnLoading = false;
  1213. this.descPop = false;
  1214. }).catch(err => {
  1215. this.btnLoading = false;
  1216. this.descPop = false;
  1217. })
  1218. },
  1219. updateMobile(){
  1220. this.btnLoading = true;
  1221. this.$confirm('修改手机号后,登录账号也将相应的修改为新手机号?', '提示', {
  1222. confirmButtonText: '确定',
  1223. cancelButtonText: '取消',
  1224. type: 'warning'
  1225. }).then(() => {
  1226. request({
  1227. params: {
  1228. r: 'mall/user/update-mobile'
  1229. },
  1230. method: 'post',
  1231. data: {
  1232. mobile: this.mobile,
  1233. user_id: this.user_id
  1234. }
  1235. }).then(res => {
  1236. if(res.data.code == 0){
  1237. this.$message.success(res.data.msg);
  1238. this.detailInfo.mobile = this.mobile;
  1239. } else{
  1240. this.$message.error(res.data.msg);
  1241. }
  1242. this.btnLoading = false;
  1243. this.descPop = false;
  1244. }).catch(err => {
  1245. this.btnLoading = false;
  1246. this.descPop = false;
  1247. })
  1248. }).catch(err => {
  1249. this.btnLoading = false;
  1250. })
  1251. },
  1252. openAddress() {
  1253. request({
  1254. params: {
  1255. r: 'common/region/list',
  1256. level: 3
  1257. },
  1258. }).then(res => {
  1259. this.province = res.data.data.list;
  1260. for (let i = 0; i < this.province.length; i++) {
  1261. if (this.regionArr[0] == this.province[i].name) {
  1262. this.city = this.province[i].children
  1263. }
  1264. }
  1265. for (let i = 0; i < this.city.length; i++) {
  1266. if (this.regionArr[1] == this.city[i].name) {
  1267. this.district = this.city[i].children
  1268. }
  1269. }
  1270. })
  1271. },
  1272. // 获取城市列表
  1273. getCity() {
  1274. for (let i = 0; i < this.province.length; i++) {
  1275. if (this.regionArr[0] == this.province[i].name) {
  1276. this.city = this.province[i].children
  1277. this.regionArr[1] = this.city[0].name
  1278. this.district = this.city[0].children
  1279. this.regionArr[2] = this.district[0].name
  1280. this.userForm.province = this.province[i].name;
  1281. }
  1282. }
  1283. },
  1284. // 获取区县
  1285. getDistrict() {
  1286. for (let i = 0; i < this.city.length; i++) {
  1287. if (this.regionArr[1] == this.city[i].name) {
  1288. this.district = this.city[i].children
  1289. this.regionArr[2] = this.district[0].name
  1290. this.userForm.city = this.city[i].name;
  1291. }
  1292. }
  1293. },
  1294. getArea(e) {
  1295. this.district.forEach((it, i) => {
  1296. if (it.name == e) {
  1297. this.userForm.area = it.name;
  1298. }
  1299. })
  1300. },
  1301. // 编辑会员资料弹窗
  1302. updateUserInfoPop(){
  1303. this.regionArr = [this.detailInfo.area.province,this.detailInfo.area.city,this.detailInfo.area.area];
  1304. this.openAddress();
  1305. this.userInfoPop = true;
  1306. this.userForm.sex = Boolean(this.detailInfo.sex)?this.detailInfo.sex + '':'';
  1307. this.userForm.birthday = this.detailInfo.birthday;
  1308. this.userForm.wechat = this.detailInfo.wechat;
  1309. this.userForm.id_card = this.detailInfo.id_card;
  1310. this.userForm.province = this.detailInfo.area.province;
  1311. this.userForm.city = this.detailInfo.area.city;
  1312. this.userForm.area = this.detailInfo.area.area;
  1313. },
  1314. // 修改会员资料
  1315. updateUserInfo(){
  1316. let boo = /^[1-9]\d{5}[1-9]\d{3}((0\d)|(1[0-2]))(([0|1|2]\d)|3[0-1])\d{3}(\d|x|X)$/.test(this.userForm.id_card);
  1317. if(this.userForm.id_card.length > 0 && boo == false){
  1318. this.$message.error("身份证格式错误");
  1319. return;
  1320. }
  1321. this.btnLoading = true;
  1322. this.userForm.user_id = this.user_id;
  1323. if(!this.userForm.province){
  1324. this.userForm.province = '';
  1325. }
  1326. if(!this.userForm.city){
  1327. this.userForm.city = '';
  1328. }
  1329. if(!this.userForm.area){
  1330. this.userForm.area = '';
  1331. }
  1332. if(!this.userForm.sex){
  1333. this.userForm.sex = 0;
  1334. }
  1335. request({
  1336. params: {
  1337. r: 'mall/user/user-extra-edit'
  1338. },
  1339. method: 'post',
  1340. data: this.userForm,
  1341. }).then(res => {
  1342. console.info(res);
  1343. if(res.data.code == 0){
  1344. this.detailInfo.sex = Boolean(this.userForm.sex)? this.userForm.sex + '':'';
  1345. // this.userForm.sex = Boolean(this.detailInfo.sex)?this.detailInfo.sex + '':'';
  1346. this.detailInfo.sex_text = this.userForm.sex == 1?'男':this.userForm.sex == 2?'女':'未知';
  1347. this.detailInfo.birthday = this.userForm.birthday;
  1348. this.detailInfo.wechat = this.userForm.wechat;
  1349. this.detailInfo.id_card = this.userForm.id_card;
  1350. this.detailInfo.area.province = this.userForm.province;
  1351. this.detailInfo.area.city = this.userForm.city;
  1352. this.detailInfo.area.area = this.userForm.area;
  1353. this.$message.success(res.data.msg);
  1354. }else{
  1355. this.$message.error(res.data.msg);
  1356. }
  1357. this.userInfoPop = false;
  1358. this.btnLoading = false;
  1359. }).catch(err => {
  1360. this.userInfoPop = false;
  1361. this.btnLoading = false;
  1362. })
  1363. },
  1364. handleRedpack(){
  1365. this.redpackForm.redpack_money = "";
  1366. this.redpackForm.remark = "";
  1367. this.dialogRedpack = true;
  1368. },
  1369. // 余额验证
  1370. redpackSubmit() {
  1371. this.btnLoading = true;
  1372. request({
  1373. params: {
  1374. r: 'mall/user/redpack',
  1375. },
  1376. method: 'post',
  1377. data: {
  1378. user_id:this.user_id,
  1379. type:this.redpackForm.redpack_type,
  1380. money:this.redpackForm.redpack_money,
  1381. desc:this.redpackForm.remark},
  1382. }).then(e => {
  1383. if (e.data.code === 0) {
  1384. this.dialogRedpack = false;
  1385. // location.reload();
  1386. this.getList();
  1387. } else {
  1388. this.$message.error(e.data.msg);
  1389. }
  1390. this.dialogBalance = false;
  1391. this.btnLoading = false;
  1392. }).catch(e => {
  1393. this.dialogBalance = false;
  1394. this.btnLoading = false;
  1395. });
  1396. },
  1397. // 关闭积分余额窗口
  1398. closePop(){
  1399. this.hintBoo = false;
  1400. this.integralOrBalanceType = 1;
  1401. },
  1402. // 余额验证
  1403. balanceSubmit() {
  1404. // 批量清零
  1405. if(this.integralOrBalanceType == 2){
  1406. this.balanceRequest();
  1407. return;
  1408. }
  1409. // 表单验证
  1410. this.$refs.integralForm.validate((valid) => {
  1411. if (valid) {
  1412. this.balanceRequest();
  1413. }
  1414. });
  1415. },
  1416. //余额充值请求接口
  1417. balanceRequest(){
  1418. let num = Number(this.balanceForm.price);
  1419. num >= 0 ?this.balanceForm.type = 1:this.balanceForm.type = 2;
  1420. let para = Object.assign({}, this.balanceForm);
  1421. this.btnLoading = true;
  1422. request({
  1423. params: {
  1424. r: 'mall/user/balance',
  1425. },
  1426. method: 'post',
  1427. data: para,
  1428. }).then(e => {
  1429. if (e.data.code === 0) {
  1430. location.reload();
  1431. // this.getList();
  1432. } else {
  1433. this.$message.error(e.data.msg);
  1434. }
  1435. this.dialogBalance = false;
  1436. this.btnLoading = false;
  1437. }).catch(e => {
  1438. this.dialogBalance = false;
  1439. this.btnLoading = false;
  1440. });
  1441. },
  1442. // 积分充值验证
  1443. integralSubmit() {
  1444. if(this.integralOrBalanceType == 2){
  1445. this.integralRequest();
  1446. return;
  1447. }
  1448. this.$refs.integralForm.validate((valid) => {
  1449. if (valid) {
  1450. this.integralRequest();
  1451. }
  1452. });
  1453. },
  1454. // 请求积分充值接口
  1455. integralRequest(){
  1456. let num = Number(this.integralForm.num);
  1457. num >= 0 ?this.integralForm.type = 1:this.integralForm.type = 2;
  1458. let para = Object.assign({}, this.integralForm);
  1459. this.btnLoading = true;
  1460. request({
  1461. params: {
  1462. r: 'mall/user/score',
  1463. },
  1464. method: 'post',
  1465. data: para,
  1466. }).then(e => {
  1467. if (e.data.code === 0) {
  1468. location.reload();
  1469. // this.integralForm.num = "";
  1470. // this.getList();
  1471. } else {
  1472. this.$message.error(e.data.msg);
  1473. }
  1474. this.dialogIntegral = false;
  1475. this.btnLoading = false;
  1476. this.hintBoo = false;
  1477. }).catch(e => {
  1478. this.dialogIntegral = false;
  1479. this.btnLoading = false;
  1480. this.hintBoo = false;
  1481. });
  1482. },
  1483. // 货币充值
  1484. currencySubmit(){
  1485. // 表单验证
  1486. this.$refs.integralForm.validate((valid) => {
  1487. if (valid) {
  1488. let para = Object.assign({}, this.currencyForm);
  1489. this.btnLoading = true;
  1490. request({
  1491. params: {
  1492. r: 'mall/user/add-currency',
  1493. },
  1494. method: 'post',
  1495. data: para,
  1496. }).then(res => {
  1497. console.info(res);
  1498. if(res.data.code == 0){
  1499. location.reload();
  1500. // this.getList();
  1501. }else {
  1502. this.$message.error(res.data.msg);
  1503. }
  1504. this.currencyBoo = false;
  1505. this.btnLoading = false;
  1506. }).catch(err => {
  1507. this.currencyBoo = false;
  1508. this.btnLoading = false;
  1509. })
  1510. }
  1511. })
  1512. },
  1513. // 获取货币列表
  1514. getCurrencyList(){
  1515. request({
  1516. params: {
  1517. r: 'mall/user/get-currency-list'
  1518. },
  1519. method: 'get'
  1520. }).then(res => {
  1521. console.info(res);
  1522. if(res.data.code == 0){
  1523. this.currencyList = res.data.data.list;
  1524. }
  1525. })
  1526. },
  1527. // 充值
  1528. addM(type,code){
  1529. if(type == 'balance'){
  1530. this.balanceForm.user_id = this.user_id;
  1531. this.dialogBalance = true;
  1532. } else if(type == 'score'){
  1533. this.integralForm.user_id = this.user_id;
  1534. this.integralForm.num = "";
  1535. this.dialogIntegral = true;
  1536. } else if(type == 'currency'){
  1537. this.currencyForm = {
  1538. type: '1',
  1539. code:'',
  1540. money: '',
  1541. desc: '',
  1542. }
  1543. this.currencyForm.code = code;
  1544. this.specifyCurrency = false;
  1545. this.currencyForm.user_id = this.user_id;
  1546. this.currencyBoo = true;
  1547. } else if(type == 'red_packet'){
  1548. this.currencyForm = {
  1549. type: '1',
  1550. code:'red_packet',
  1551. money: '',
  1552. desc: '',
  1553. }
  1554. this.specifyCurrency = true;
  1555. this.currencyForm.user_id = this.user_id;
  1556. this.currencyBoo = true;
  1557. } else if(type == 'redpack'){
  1558. this.handleRedpack();
  1559. } else if(type == 'digital'){
  1560. this.dialogDigital = true;
  1561. this.digitalForm.user_id = this.user_id;
  1562. }
  1563. },
  1564. getTagIds(){
  1565. this.balanceForm.user_id = this.user_id;
  1566. this.detailInfo.tag.forEach((v,i) => {
  1567. this.lableValue.push(v.label_id);
  1568. })
  1569. },
  1570. // 编辑标签
  1571. upTag(){
  1572. this.lableValue = [];
  1573. this.getTagIds();
  1574. this.labelBoo = true;
  1575. },
  1576. getTagList(){
  1577. request({
  1578. params: {
  1579. r: 'mall/user-label/get-mall-label'
  1580. },
  1581. method: 'post'
  1582. }).then(res => {
  1583. if(res.data.code == 0){
  1584. this.userTagList = res.data.data;
  1585. console.info(this.userTagList);
  1586. }
  1587. })
  1588. },
  1589. // 删除标签
  1590. delTag(id){ console.log(id,888888);
  1591. this.getTagIds();
  1592. let index = this.lableValue.findIndex(v => v == id);
  1593. this.tagLoading = true;
  1594. this.lableValue.splice(index,1);
  1595. this.labelSubmit();
  1596. },
  1597. labelSubmit(){
  1598. let that = this; console.log(this.lableValue);
  1599. let url = 'mall/user-label/add-user-label'
  1600. let data = {
  1601. user_id: this.balanceForm.user_id,
  1602. label_id: JSON.stringify(this.lableValue)
  1603. }
  1604. this.tagLoading = true;
  1605. request({
  1606. params: {
  1607. r: url
  1608. },
  1609. method: 'post',
  1610. data: data
  1611. }).then(res => {
  1612. that.labelSubmitBoo = false;
  1613. if(res.data.code == 0){
  1614. that.lableValue = [];
  1615. that.getList();
  1616. }else {
  1617. that.tagLoading = false;
  1618. }
  1619. that.labelBoo = false;
  1620. }).catch(e => {
  1621. that.labelSubmitBoo = false;
  1622. that.labelBoo = false;
  1623. that.tagLoading = false;
  1624. // console.log(e);
  1625. });
  1626. },
  1627. navUserInfo(){
  1628. this.$navigate({
  1629. r: 'team-data/default/my-customer',
  1630. user_id: this.user_id
  1631. })
  1632. },
  1633. // 跳转明细
  1634. navDetail(type,code = ''){
  1635. let url = ''
  1636. if(type == 'balance'){
  1637. url = 'mall/finance/balance-log'
  1638. } else if(type == 'score'){
  1639. url = 'mall/finance/score-log'
  1640. } else if(type == 'commission'){
  1641. url = 'mall/finance/commission-log'
  1642. }else if(type == 'currency'){
  1643. url = 'mall/currency/wallet-log'
  1644. } else if(type == 'red_packet'){
  1645. // 红包明细
  1646. url = 'mall/currency/wallet-log'
  1647. } else if(type == 'coupon'){
  1648. // plugin/e_coupon/mall/approval-log/index
  1649. this.getCouponList();
  1650. this.couponBoo = true;
  1651. return;
  1652. } else if(type == 'e_coupon'){
  1653. this.getECouponList();
  1654. this.e_couponBoo = true;
  1655. return;
  1656. } else if(type == 'redpack'){
  1657. // 红包明细
  1658. url = 'redpack/wallet-log/index'
  1659. } else if(type == 'secondary_card'){
  1660. // 红包明细
  1661. url = 'secondary-card/default/order'
  1662. } else if(type == 'digital'){
  1663. // 数字币明细
  1664. url = 'mall/digital/index'
  1665. }
  1666. this.$navigate({
  1667. r: url,
  1668. user_id: this.user_id
  1669. })
  1670. },
  1671. // 打开黑白名单窗口
  1672. handleListOfNames(){
  1673. this.balanceForm = Object.assign(this.balanceForm, {
  1674. user_id: this.user_id,
  1675. status: this.detailInfo.status,
  1676. });
  1677. this.listOfNamesBoo = true;
  1678. },
  1679. // 黑白名单
  1680. listOfNamesBooSubmit(){
  1681. let that = this;
  1682. let data = "";
  1683. this.btnLoading = true;
  1684. let status = this.balanceForm.status;
  1685. if(status == 0){
  1686. status = 1;
  1687. }else if(status == 1)(
  1688. status = 0
  1689. )
  1690. data = {
  1691. user_id: this.balanceForm.user_id,
  1692. status: status
  1693. }
  1694. request({
  1695. params: {
  1696. r: 'mall/user/add-blacklist'
  1697. },
  1698. method: 'post',
  1699. data: data
  1700. }).then(res => {
  1701. if(res.data.code == 0){
  1702. this.$message.success("修改成功");
  1703. this.listOfNamesBoo = false;
  1704. this.btnLoading = false;
  1705. this.getList();
  1706. } else{
  1707. this.$message.error(res.data.msg);
  1708. }
  1709. }).catch(e => {
  1710. console.log(e);
  1711. this.btnLoading = false;
  1712. });
  1713. },
  1714. couponListTypeChange($event) {
  1715. // 重新触发获取优惠卷列表
  1716. this.getCouponList();
  1717. },
  1718. // 获取优惠卷列表
  1719. getCouponList(){
  1720. this.couponLoading = true;
  1721. // debugger;
  1722. this.couponList.splice(0,this.couponList.length);
  1723. request({
  1724. params: {
  1725. r: 'mall/user/get-user-coupon',
  1726. type: this.couponSel,
  1727. coupon_list_type: this.couponListType,
  1728. user_id: this.user_id,
  1729. page: this.couponPage,
  1730. },
  1731. }).then(res => {
  1732. //console.info(res);
  1733. if(res.data.code == 0){
  1734. this.couponListData = res.data.data.list.list;
  1735. this.couponPageCount = res.data.data.list.page_count
  1736. } else {
  1737. this.$message.error(res.data.msg);
  1738. }
  1739. this.couponLoading = false;
  1740. }).catch(err => {
  1741. this.couponLoading = false;
  1742. })
  1743. },
  1744. // 获取电子卷列表
  1745. getECouponList(){
  1746. this.e_couponLoading = true;
  1747. this.e_couponList.splice(0,this.e_couponList.length)
  1748. request({
  1749. params: {
  1750. r: 'mall/user/get-user-ecoupon'
  1751. },
  1752. method: 'post',
  1753. data: {
  1754. type: this.e_couponSel,
  1755. user_id: this.user_id,
  1756. page: this.ecouponPage,
  1757. }
  1758. }).then(res => {
  1759. if(res.data.code == 0){
  1760. this.e_couponList.push(...res.data.data.list);
  1761. this.ecouponPageCount = res.data.data.pagination.page_count;
  1762. } else {
  1763. this.$message.error(res.data.msg);
  1764. }
  1765. this.e_couponLoading = false;
  1766. }).catch(err => {
  1767. this.e_couponLoading = false;
  1768. })
  1769. },
  1770. couponClick(tab, event){
  1771. this.couponPage = 1
  1772. this.getCouponList();
  1773. },
  1774. upCouponPage(currentPage){
  1775. this.couponPage = currentPage;
  1776. this.getCouponList();
  1777. },
  1778. // 电子卷分页
  1779. upECouponPage(currentPage){
  1780. this.ecouponPage = currentPage;
  1781. this.getECouponList();
  1782. },
  1783. // 删除优惠卷
  1784. delCoupon(id){
  1785. console.info(id);
  1786. this.delPop = true;
  1787. this.delId = id;
  1788. },
  1789. // 删除卷请求
  1790. delSub(type){
  1791. // 1:优惠卷 2:电子卷
  1792. this.btnLoading = true;
  1793. if(type == 1){
  1794. request({
  1795. params: {
  1796. r: 'mall/user/del-user-coupon',
  1797. id: this.delId,
  1798. user_id: this.user_id
  1799. },
  1800. method: 'get'
  1801. }).then(res => {
  1802. // debugger;
  1803. console.info(res);
  1804. if(res.data.code == 0){
  1805. this.getCouponList();
  1806. this.$message.success("删除成功");
  1807. }else {
  1808. this.$message.error(res.data.msg);
  1809. }
  1810. this.delId = 0;
  1811. this.delPop = false;
  1812. this.btnLoading = false;
  1813. }).catch(err => {
  1814. console.info(err);
  1815. this.delId = 0;
  1816. this.delPop = false;
  1817. this.btnLoading = false;
  1818. })
  1819. } else if(type == 2){
  1820. request({
  1821. params: {
  1822. r: 'mall/user/del-user-ecoupon',
  1823. id: this.delId,
  1824. user_id: this.user_id
  1825. },
  1826. method: 'get'
  1827. }).then(res => {
  1828. // debugger;
  1829. console.info(res);
  1830. if(res.data.code == 0){
  1831. this.getECouponList();
  1832. this.$message.success("删除成功");
  1833. }else {
  1834. this.$message.error(res.data.msg);
  1835. }
  1836. this.delId = 0;
  1837. this.delPop = false;
  1838. this.btnLoading = false;
  1839. }).catch(err => {
  1840. console.info(err);
  1841. this.delId = 0;
  1842. this.delPop = false;
  1843. this.btnLoading = false;
  1844. })
  1845. }
  1846. },
  1847. // 电子卷
  1848. e_couponClick(){
  1849. this.getECouponList();
  1850. },
  1851. // 开启推广资格窗口
  1852. promotePop(){
  1853. this.promoteBoo = true;
  1854. // this.detailInfo.is_inviter
  1855. },
  1856. // 清除微信授权
  1857. clearAuth(){
  1858. this.$confirm('此操作不能恢复,确定清除吗?', '提示', {
  1859. confirmButtonText: '确定',
  1860. cancelButtonText: '取消',
  1861. type: 'warning'
  1862. }).then(() => {
  1863. request({
  1864. params: {
  1865. r: 'mall/user/clear-auth'
  1866. },
  1867. method: 'post',
  1868. data: {
  1869. user_id: this.user_id,
  1870. }
  1871. }).then(res => {
  1872. this.$message.success("清除成功");
  1873. }).catch(e => {
  1874. this.$message.error("清除失败");
  1875. });
  1876. })
  1877. },
  1878. // 推广资格
  1879. promoteSubmit(){
  1880. this.btnLoading = true;
  1881. let boo = this.detailInfo.is_inviter;
  1882. if(boo == 0){
  1883. boo = 1;
  1884. }else if(boo == 1)(
  1885. boo = 0
  1886. )
  1887. request({
  1888. params: {
  1889. r: 'mall/user/change-inviter'
  1890. },
  1891. method: 'post',
  1892. data: {
  1893. user_id: this.user_id,
  1894. is_inviter: boo
  1895. }
  1896. }).then(res => {
  1897. if(res.data.code == 0){
  1898. this.$message.success("修改成功");
  1899. this.detailInfo.is_inviter = boo;
  1900. this.promoteBoo = false;
  1901. this.btnLoading = false;
  1902. } else{
  1903. }
  1904. }).catch(e => {
  1905. console.log(e);
  1906. this.btnLoading = false;
  1907. });
  1908. },
  1909. gotoOrderIndex(){
  1910. this.$navigate({
  1911. r: 'mall/order/index',
  1912. user_id: this.user_id
  1913. })
  1914. },
  1915. updateLevel(){
  1916. this.userRankPop = true;
  1917. this.selUserRank = this.detailInfo.level + "";
  1918. },
  1919. updateRank(){
  1920. this.btnLoading = true;
  1921. request({
  1922. params: {
  1923. r: 'mall/user/edit-user-level'
  1924. },
  1925. method: 'post',
  1926. data: {
  1927. user_id: this.user_id,
  1928. level: this.selUserRank
  1929. }
  1930. }).then(res => {
  1931. console.info(res);
  1932. if(res.data.code == 0){
  1933. this.detailInfo.user_level = this.selUserRank;
  1934. let arr = JSON.parse(JSON.stringify(this.detailInfo.user_level_list));
  1935. this.$set(arr,"-1","默认会员");
  1936. arr[0] = this.default_level_name
  1937. let fruitsObj = { ...arr };
  1938. this.detailInfo.level = fruitsObj[this.selUserRank];
  1939. this.userRankPop = false;
  1940. this.selUserRank = '';
  1941. } else {
  1942. this.$message.error(res.data.msg);
  1943. }
  1944. this.btnLoading = false;
  1945. }).catch(err => {
  1946. this.btnLoading = false;
  1947. })
  1948. },
  1949. changePasswordSubmit(){
  1950. this.btnLoading = true;
  1951. let password = this.change_password;
  1952. request({
  1953. params: {
  1954. r: 'mall/user/update-password'
  1955. },
  1956. method: 'post',
  1957. data: {
  1958. user_id: this.user_id,
  1959. password: password
  1960. }
  1961. }).then(res => {
  1962. if(res.data.code == 0){
  1963. this.$message.success("修改成功");
  1964. this.changePasswordPop = false;
  1965. } else{
  1966. this.$message.error(res.data.msg);
  1967. }
  1968. this.btnLoading = false;
  1969. }).catch(e => {
  1970. console.log(e);
  1971. this.btnLoading = false;
  1972. });
  1973. },
  1974. /**
  1975. * 获取登录设备文本
  1976. */
  1977. getDeviceTypeText(device) {
  1978. // 可添加处理
  1979. return device
  1980. },
  1981. paymentAckPassword(rule, value, callback) {// 确认密码验证
  1982. if (value === '') {
  1983. callback(new Error('请输入确认密码'));
  1984. } else if (value.length < 6) {
  1985. callback(new Error('确认密码不能小于六位数'));
  1986. } else if (value !== this.paymentForm.password) {
  1987. callback(new Error('两次密码不一致'));
  1988. } else {
  1989. callback();
  1990. }
  1991. },
  1992. resetPaymentPasswordSubmit() {
  1993. // 重置支付密码提交
  1994. this.$refs.paymentForm.validate((valid) => {
  1995. if (valid) {
  1996. this.btnLoading = true;
  1997. request({
  1998. params: {
  1999. r: 'mall/user/reset-payment-password'
  2000. },
  2001. method: 'post',
  2002. data: {
  2003. user_id: this.user_id,
  2004. password: this.paymentForm.password
  2005. }
  2006. }).then(res => {
  2007. if(res.data.code === 0){
  2008. let that = this;
  2009. this.$message({
  2010. type: 'success',
  2011. message: '修改成功',
  2012. duration: 2000,
  2013. onClose: function () {
  2014. that.clearResetPayment();
  2015. }
  2016. })
  2017. } else{
  2018. this.$message.error(res.data.msg);
  2019. }
  2020. this.btnLoading = false;
  2021. }).catch(e => {
  2022. console.log(e);
  2023. this.btnLoading = false;
  2024. });
  2025. } else {
  2026. return false;
  2027. }
  2028. })
  2029. },
  2030. clearResetPayment() {// 清除支付表单数据
  2031. this.$refs.paymentForm.resetFields();
  2032. this.paymentForm = {
  2033. is_reset_box_show: false,
  2034. password: null,
  2035. ack_password: null,
  2036. }
  2037. },
  2038. digitalSubmit(){
  2039. // 表单验证
  2040. this.$refs.dialogForm.validate((valid) => {
  2041. if (valid) {
  2042. let para = Object.assign({}, this.digitalForm);
  2043. this.btnLoading = true;
  2044. request({
  2045. params: {
  2046. r: 'mall/user/add-digital',
  2047. },
  2048. method: 'post',
  2049. data: para,
  2050. }).then(res => {
  2051. console.info(res);
  2052. if(res.data.code == 0){
  2053. location.reload();
  2054. // this.getList();
  2055. }else {
  2056. this.$message.error(res.data.msg);
  2057. }
  2058. this.currencyBoo = false;
  2059. this.btnLoading = false;
  2060. }).catch(err => {
  2061. this.currencyBoo = false;
  2062. this.btnLoading = false;
  2063. })
  2064. }
  2065. })
  2066. },
  2067. }
  2068. })
  2069. </script>
  2070. <style>
  2071. .el-main{
  2072. flex-basis: unset;
  2073. display: flex;
  2074. display: -webkit-flex;
  2075. }
  2076. #user_detail_view{
  2077. flex: 1;
  2078. }
  2079. .user_info{
  2080. background: #FFF;
  2081. padding: 20px;
  2082. margin-bottom: 10px;
  2083. }
  2084. .user_detail{
  2085. display: flex;
  2086. /* align-items: center; */
  2087. }
  2088. .user_detail .info{
  2089. display: flex;
  2090. font-size: 12px;
  2091. color: #939393;
  2092. }
  2093. .user_detail .info .text{
  2094. color: #000;
  2095. margin-right: 40px;
  2096. }
  2097. .user_detail .user_name{
  2098. font-size: 15px;
  2099. margin-bottom: 10px;
  2100. }
  2101. .user_material{
  2102. display: flex;
  2103. margin-bottom: 10px;
  2104. }
  2105. .material_m{
  2106. background: #FFF;
  2107. flex: 1;
  2108. padding: 10px 30px
  2109. }
  2110. .material_m:first-child{
  2111. margin-right: 8px;
  2112. }
  2113. .material_m:last-child{
  2114. margin-left: 8px;
  2115. }
  2116. .material_title{
  2117. font-size: 16px;
  2118. margin-bottom: 20px;
  2119. border-left: 5px solid #1479F0;
  2120. padding-left: 8px;
  2121. line-height: 24px;
  2122. }
  2123. .my_flex{
  2124. display: flex;
  2125. }
  2126. .assets_title{
  2127. font-size: 16px;
  2128. margin-bottom: 15px;
  2129. align-items: flex-end;
  2130. }
  2131. .assets_info{
  2132. flex: 1;
  2133. }
  2134. .assets_info .info{
  2135. /* font-weight: bold; */
  2136. margin-top: 5px;
  2137. font-size: 20px;
  2138. }
  2139. .assets_mo{
  2140. background: #F2F2F2;
  2141. padding: 20px 30px;
  2142. }
  2143. .title_bu{
  2144. font-size: 12px;
  2145. color: #2E8FF6;
  2146. margin-left: 10px;
  2147. }
  2148. .title_bu:hover{
  2149. cursor:pointer;
  2150. }
  2151. .hover-close:hover{
  2152. color: #2E8FF6;
  2153. cursor:pointer;
  2154. }
  2155. .title_bu_text{
  2156. font-size: 12px;
  2157. color: #2E8FF6;
  2158. }
  2159. .title_bu_text:hover{
  2160. cursor:default;
  2161. }
  2162. .lable_i{
  2163. background: #F4F4F4;
  2164. padding: 5px 15px;
  2165. margin-right: 14px;
  2166. }
  2167. .round_page{
  2168. display: flex;
  2169. justify-content: center;
  2170. }
  2171. .round{
  2172. width: 10px;
  2173. height: 10px;
  2174. background: #F2F2F2;
  2175. border-radius: 50%;
  2176. margin-right: 10px;
  2177. }
  2178. .page_sel{
  2179. background: #2E8FF4;
  2180. }
  2181. .el-dialog__body {
  2182. padding: 15px 20px 20px;
  2183. }
  2184. .up_user_s .el-select{
  2185. margin-right: 10px;
  2186. }
  2187. </style>