custom.vue 11 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452
  1. <template>
  2. <view class="content">
  3. <!-- <view class="contLineBox" v-if="!customerInfo">
  4. <view class="contLine" >
  5. <view class="lineTitle">手机号</view>
  6. <view class="lineRgiht2" @click="editIphone">请输入手机号,以获取更多信息
  7. </view>
  8. </view>
  9. </view> -->
  10. <view class="contLineBox" >
  11. <view class="contLine" v-if="customerInfo.mobilePhone">
  12. <view class="lineTitle" >手机号</view>
  13. <view class="lineRgiht lineRgihtSjh" @click="editIphone">
  14. <span>{{customerInfo.mobilePhone}}</span>
  15. <image class="jiantou" src="../../static/img/big_rightArrow.png" mode=""></image>
  16. </view>
  17. </view>
  18. <view class="contLine" v-if="!customerInfo.mobilePhone">
  19. <view class="lineTitle">手机号</view>
  20. <view class="lineRgiht2" @click="editIphone">请输入手机号,以获取更多信息
  21. </view>
  22. </view>
  23. <view class="contLine">
  24. <view class="lineTitle">姓名</view>
  25. <view class="lineRgiht">{{customerInfo.customerName}}</view>
  26. </view>
  27. <view class="contLine">
  28. <view class="lineTitle">客户来源</view>
  29. <view class="lineRgiht">{{customerInfo.name}}</view>
  30. </view>
  31. <view class="contLine">
  32. <view class="lineTitle">客户等级</view>
  33. <view class="lineRgiht">{{customerInfo.levelName}}</view>
  34. </view>
  35. <view class="contLine" style="padding-bottom: 14rpx;">
  36. <view class="lineTitle">客户标签</view>
  37. <view class="titleBox">
  38. <view class="title" v-for="(item,index) in customerInfo.lables">{{item.name}}</view>
  39. </view>
  40. </view>
  41. <view class="contLine">
  42. <view class="lineTitle">客户类型</view>
  43. <view class="lineRgiht" v-if="customerInfo.cusromerType==1">个人</view>
  44. <view class="lineRgiht" v-if="customerInfo.cusromerType==2">单位</view>
  45. </view>
  46. <view class="contLine" v-if="customerInfo.cusromerType==2">
  47. <view class="lineTitle">单位名称</view>
  48. <view class="lineRgiht">{{customerInfo.unitName}}</view>
  49. </view>
  50. <view class="contLine">
  51. <view class="lineTitle">服务顾问</view>
  52. <view class="lineRgiht">{{customerInfo.usersName}}</view>
  53. </view>
  54. <view class="contLine">
  55. <view class="lineTitle">所属门店</view>
  56. <view class="lineRgiht">{{customerInfo.shopName}}</view>
  57. </view>
  58. <view class="contLine">
  59. <view class="lineTitle">创建时间</view>
  60. <view class="lineRgiht">{{customerInfo.createTime}}</view>
  61. </view>
  62. </view>
  63. <view class="box" >
  64. <view class="boxTitle">信用额度</view>
  65. <view class="creditBox">
  66. <view class="creditLine">
  67. <view class="creditTitle">剩余记账:</view>
  68. <view class="creditNum">{{customerInfo.stayInMoney}}</view>
  69. </view>
  70. <view class="creditLine">
  71. <view class="creditTitle">超期账款:</view>
  72. <view class="creditNum">{{customerInfo.overdueMoney}}</view>
  73. </view>
  74. <view class="creditLine">
  75. <view class="creditTitle">最近到期日:</view>
  76. <view class="creditNum">{{customerInfo.dueDate}}</view>
  77. </view>
  78. <view class="creditLine">
  79. <view class="creditTitle">可用额度:</view>
  80. <view class="creditNum" v-if="keyongMoney">{{keyongMoney.toFixed(2)}}</view>
  81. </view>
  82. <view class="creditLine">
  83. <view class="creditTitle">信用额度:</view>
  84. <view class="creditNum">{{customerInfo.creditMoney}}</view>
  85. </view>
  86. </view>
  87. </view>
  88. <view class="box" >
  89. <view class="boxTitle2" @click="moreBtn">更多
  90. <image class="boxIcon" v-if="moreShow" src="../../static/img/icon_arrow_up.png" mode=""></image>
  91. <image class="boxIcon" v-if="!moreShow" src="../../static/img/icon_arrow_down.png" mode=""></image>
  92. </view>
  93. <view v-if="moreShow">
  94. <view class="contLine">
  95. <view class="lineTitle">证件类型</view>
  96. <view class="lineRgiht">{{customerInfo.idType}}</view>
  97. </view>
  98. <view class="contLine">
  99. <view class="lineTitle">证件号码</view>
  100. <view class="lineRgiht">{{customerInfo.idCode}}</view>
  101. </view>
  102. <view class="contLine">
  103. <view class="lineTitle">所在地区</view>
  104. <view class="lineRgiht">{{customerInfo.provinceName}}{{customerInfo.cityName}}{{customerInfo.areaName}}</view>
  105. </view>
  106. <view class="contLine">
  107. <view class="lineTitle">详细地址</view>
  108. <view class="lineRgiht">{{customerInfo.address}}</view>
  109. </view>
  110. <view class="contLine">
  111. <view class="lineTitle">推广员工</view>
  112. <view class="lineRgiht">{{customerInfo.proUserName}}</view>
  113. </view>
  114. <view class="contLine">
  115. <view class="lineTitle">推广客户</view>
  116. <view class="lineRgiht">{{customerInfo.proCustomerName}}</view>
  117. </view>
  118. <view class="contLine" >
  119. <view class="lineTitle">生日</view>
  120. <view class="lineRgiht" v-if="customerInfo">
  121. <span v-if="customerInfo.birthday">{{customerInfo.birthday.slice(0,10)}}</span>
  122. </view>
  123. </view>
  124. <view class="contLine">
  125. <view class="lineTitle">客户备注</view>
  126. <view class="lineRgiht">{{customerInfo.comment}}</view>
  127. </view>
  128. </view>
  129. </view>
  130. <view style="height: 40rpx;"></view>
  131. <uni-popup ref="popup" type="bottom" >
  132. <view class="popupBox">
  133. <view class="popupTitleBox">
  134. <view class="popupTitle">修改手机号</view>
  135. <image src="../../static/img/cha.png" mode="" @click="pBcancel" class="chaImg"></image>
  136. </view>
  137. <view class="popupMs">此处修改手机号后,将根据新手机号重新匹配客户信息</view>
  138. <view class="inputBox">
  139. <!-- <view class="inputMs">手机号</view> -->
  140. <input type="text" v-model="extUserMobile" class="iphoneInput" placeholder="请输入手机号" />
  141. <image v-show="extUserMobile" src="../../static/img/icon_delete.png" mode="" class="delInput" @click="extUserMobile=''"></image>
  142. </view>
  143. <view class="pBottom">
  144. <view class="pBcancel" @click="pBcancel">取消</view>
  145. <view class="pBBtn" @click="extCustomerMobile">确定</view>
  146. </view>
  147. </view>
  148. </uni-popup>
  149. </view>
  150. </template>
  151. <script>
  152. export default {
  153. props:['token'],
  154. data() {
  155. return {
  156. extUserMobile:'',
  157. customerInfo:'',
  158. customerId:'',
  159. unionID:'',
  160. keyongMoney:'',
  161. moreShow:false,
  162. userId:'',
  163. corpID:'',
  164. }
  165. },
  166. onLoad() {
  167. },
  168. methods: {
  169. moreBtn(){
  170. this.moreShow=!this.moreShow
  171. },
  172. getdata(){
  173. this.extCustomerInfo()
  174. },
  175. extCustomerInfo(){
  176. uni.showLoading({
  177. title: '加载中'
  178. });
  179. var that=this;
  180. this.userId=uni.getStorageSync('userId')
  181. this.corpID=uni.getStorageSync('corpID')
  182. /* this.corpID='wpMGjbBgAA_zIu6wbKy48zFSbGiGeP8g'
  183. this.agentId='1000051' */
  184. this.$http('enterprise/wechat/extCustomerInfo', {
  185. corpID:this.corpID,
  186. extUserId:this.userId,
  187. token:this.token
  188. }, 'GET').then(res => {
  189. uni.hideLoading();
  190. if(res.code!=1){
  191. this.customerInfo=''
  192. }else{
  193. this.customerInfo=res.data.customerInfo
  194. this.customerId=this.customerInfo.id
  195. var unionID = this.customerInfo.unionID
  196. uni.setStorage({
  197. key: 'customerId',
  198. data: that.customerId,
  199. success: function () { }
  200. });
  201. uni.setStorage({
  202. key: 'unionID',
  203. data:unionID ,
  204. success: function () { }
  205. });
  206. this.keyongMoney= this.customerInfo.creditMoney - this.customerInfo.stayInMoney
  207. this.keyongMoney.toFixed(2)
  208. }
  209. })
  210. },
  211. extCustomerMobile(){
  212. var that=this;
  213. uni.showLoading({
  214. title: '加载中'
  215. });
  216. this.userId=uni.getStorageSync('userId')
  217. this.corpID=uni.getStorageSync('corpID')
  218. /* this.corpID='wpMGjbBgAA_zIu6wbKy48zFSbGiGeP8g'
  219. this.agentId='1000051' */
  220. this.$http('enterprise/wechat/extCustomerMobile', {
  221. corpID:this.corpID,
  222. extUserId: this.userId,
  223. extUserMobile:this.extUserMobile
  224. }, 'POST').then(res => {
  225. uni.hideLoading();
  226. if(res.code!=1){
  227. uni.showToast({
  228. title: res.msg,
  229. icon: 'none',
  230. duration: 3000
  231. });
  232. }else{
  233. uni.showToast({
  234. title: res.data,
  235. icon: 'none',
  236. duration: 3000
  237. });
  238. this.pBcancel()
  239. this.extCustomerInfo()
  240. this.$emit('getUser')
  241. }
  242. }).catch(err=>{
  243. })
  244. },
  245. editIphone(){
  246. if(this.customerInfo){
  247. this.extUserMobile = this.customerInfo.mobilePhone
  248. }
  249. this.$refs.popup.open('bottom')
  250. },
  251. pBcancel(){
  252. this.$refs.popup.close()
  253. }
  254. }
  255. }
  256. </script>
  257. <style scoped>
  258. .contLineBox{
  259. background: #fff;
  260. }
  261. .contLine{
  262. display: flex;
  263. justify-content: space-between;
  264. border-bottom: 1px solid #F6F6F6;
  265. padding: 28rpx 24rpx;
  266. font-size: 28rpx;
  267. }
  268. .lineTitle{
  269. color: #666666;
  270. width:200rpx ;
  271. }
  272. .lineRgiht{
  273. color: #3C3C3C;
  274. }
  275. .lineRgiht2{
  276. color: #FF8113;
  277. }
  278. .titleBox{
  279. display: flex; flex-wrap: wrap;
  280. width: 500rpx;justify-content: flex-end;
  281. }
  282. .title{
  283. /* height: 36rpx; */
  284. border-radius: 4rpx;
  285. border: 1px solid #FF8113;
  286. /* line-height: 36rpx; */
  287. font-size: 24rpx;
  288. color: #FF8113;
  289. padding: 4rpx 8rpx;
  290. margin-right: 10rpx;
  291. margin-bottom: 10rpx;
  292. }
  293. .box{
  294. margin-top: 20rpx;background: #fff;
  295. }
  296. .boxTitle{
  297. font-weight: 500;
  298. font-size: 28rpx;
  299. color: #3C3C3C;
  300. padding: 28rpx 24rpx;
  301. border-bottom: 1px solid #EEEEEE;
  302. }
  303. .creditBox{
  304. display: flex;
  305. flex-wrap: wrap;
  306. padding-top: 16rpx;
  307. padding-bottom: 16rpx;
  308. }
  309. .creditLine{
  310. width: 50%;display: flex;
  311. padding-top: 8rpx;
  312. padding-bottom: 8rpx;
  313. font-size: 26rpx;
  314. color: #666666;
  315. }
  316. .creditNum{
  317. color: #3C3C3C;
  318. }
  319. .creditTitle{
  320. padding-left: 24rpx;
  321. }
  322. .boxTitle2{
  323. display: flex;
  324. justify-content: space-between;
  325. font-weight: 500;
  326. font-size: 28rpx;
  327. color: #3C3C3C;
  328. padding: 28rpx 24rpx;
  329. border-bottom: 1px solid #EEEEEE;
  330. }
  331. .boxIcon{
  332. width: 26rpx;height: 16rpx;
  333. margin-top: 6rpx;
  334. }
  335. .popupBox{
  336. width: 750rpx;
  337. height: 809rpx;
  338. background: #FFFFFF;
  339. border-radius: 32rpx 32rpx 0rpx 0rpx;
  340. position: fixed;
  341. left: 0;
  342. bottom: 0;
  343. }
  344. .popupTitleBox{
  345. display: flex;
  346. justify-content: space-between;
  347. padding: 30rpx;
  348. }
  349. .popupTitle{
  350. font-size: 30rpx;
  351. color: #3C3C3C;
  352. line-height: 42rpx;
  353. font-weight: 600;
  354. }
  355. .chaImg{
  356. width: 27rpx;height: 27rpx;margin-top: 9rpx;
  357. }
  358. .popupMs{
  359. font-size: 26rpx;
  360. color: #FF8113;
  361. padding-left: 24rpx;
  362. padding-bottom: 20rpx;
  363. border-bottom: 1px solid #EEEEEE;
  364. }
  365. .inputBox{
  366. display: flex;
  367. padding: 0 24rpx;
  368. line-height: 98rpx;
  369. border-bottom: 1px solid #EEEEEE;
  370. }
  371. .iphoneInput{
  372. line-height: 1;
  373. height: 98rpx;
  374. /* padding-left: 40rpx; */
  375. -webkit-text-size-adjust: none;
  376. }
  377. .iphoneInput{
  378. line-height: 98rpx;
  379. }
  380. .pBottom{
  381. position: absolute;
  382. left: 0;
  383. bottom: 0;
  384. width: 750rpx;
  385. padding: 24rpx 0rpx;
  386. background: #FFFFFF;
  387. box-shadow: 0rpx -2rpx 20rpx 0rpx rgba(153,153,153,0.2);
  388. display: flex;
  389. justify-content: space-around;
  390. }
  391. .pBcancel{
  392. width: 331rpx;
  393. border-radius: 37rpx;
  394. border: 2rpx solid #DDDDDD;
  395. padding: 16rpx 0;
  396. text-align: center;
  397. font-weight: 500;
  398. font-size: 28rpx;
  399. color: #3C3C3C;
  400. }
  401. .pBBtn{
  402. width: 331rpx;
  403. padding: 16rpx 0;
  404. background: #FF8113;
  405. border-radius: 37rpx;
  406. text-align: center;
  407. font-weight: 500;
  408. font-size: 28rpx;
  409. color: #FEFFFE;
  410. }
  411. .jiantou{
  412. width: 30rpx;height: 30rpx;
  413. margin-top: 4rpx;
  414. }
  415. .lineRgihtSjh{
  416. display: flex;
  417. }
  418. .delInput{
  419. width: 30rpx;
  420. height: 30rpx;
  421. margin-top: 30rpx;
  422. }
  423. .inputBox{
  424. justify-content: space-between;
  425. }
  426. </style>