custom.vue 11 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442
  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. uni.setStorage({
  196. key: 'customerId',
  197. data: that.customerId,
  198. success: function () { }
  199. });
  200. this.keyongMoney= this.customerInfo.creditMoney - this.customerInfo.stayInMoney
  201. this.keyongMoney.toFixed(2)
  202. }
  203. })
  204. },
  205. extCustomerMobile(){
  206. var that=this;
  207. uni.showLoading({
  208. title: '加载中'
  209. });
  210. this.userId=uni.getStorageSync('userId')
  211. this.corpID=uni.getStorageSync('corpID')
  212. /* this.corpID='wpMGjbBgAA_zIu6wbKy48zFSbGiGeP8g'
  213. this.agentId='1000051' */
  214. this.$http('enterprise/wechat/extCustomerMobile', {
  215. corpID:this.corpID,
  216. extUserId: this.userId,
  217. extUserMobile:this.extUserMobile
  218. }, 'POST').then(res => {
  219. uni.hideLoading();
  220. if(res.code!=1){
  221. uni.showToast({
  222. title: res.msg,
  223. icon: 'none',
  224. duration: 3000
  225. });
  226. }else{
  227. uni.showToast({
  228. title: res.data,
  229. icon: 'none',
  230. duration: 3000
  231. });
  232. this.pBcancel()
  233. this.extCustomerInfo()
  234. this.$emit('getUser')
  235. }
  236. }).catch(err=>{
  237. })
  238. },
  239. editIphone(){
  240. console.log(this.token)
  241. this.$refs.popup.open('bottom')
  242. },
  243. pBcancel(){
  244. this.$refs.popup.close()
  245. }
  246. }
  247. }
  248. </script>
  249. <style scoped>
  250. .contLineBox{
  251. background: #fff;
  252. }
  253. .contLine{
  254. display: flex;
  255. justify-content: space-between;
  256. border-bottom: 1px solid #F6F6F6;
  257. padding: 28rpx 24rpx;
  258. font-size: 28rpx;
  259. }
  260. .lineTitle{
  261. color: #666666;
  262. width:200rpx ;
  263. }
  264. .lineRgiht{
  265. color: #3C3C3C;
  266. }
  267. .lineRgiht2{
  268. color: #FF8113;
  269. }
  270. .titleBox{
  271. display: flex; flex-wrap: wrap;
  272. width: 500rpx;justify-content: flex-end;
  273. }
  274. .title{
  275. /* height: 36rpx; */
  276. border-radius: 4rpx;
  277. border: 1px solid #FF8113;
  278. /* line-height: 36rpx; */
  279. font-size: 24rpx;
  280. color: #FF8113;
  281. padding: 4rpx 8rpx;
  282. margin-right: 10rpx;
  283. margin-bottom: 10rpx;
  284. }
  285. .box{
  286. margin-top: 20rpx;background: #fff;
  287. }
  288. .boxTitle{
  289. font-weight: 500;
  290. font-size: 28rpx;
  291. color: #3C3C3C;
  292. padding: 28rpx 24rpx;
  293. border-bottom: 1px solid #EEEEEE;
  294. }
  295. .creditBox{
  296. display: flex;
  297. flex-wrap: wrap;
  298. padding-top: 16rpx;
  299. padding-bottom: 16rpx;
  300. }
  301. .creditLine{
  302. width: 50%;display: flex;
  303. padding-top: 8rpx;
  304. padding-bottom: 8rpx;
  305. font-size: 26rpx;
  306. color: #666666;
  307. }
  308. .creditNum{
  309. color: #3C3C3C;
  310. }
  311. .creditTitle{
  312. padding-left: 24rpx;
  313. }
  314. .boxTitle2{
  315. display: flex;
  316. justify-content: space-between;
  317. font-weight: 500;
  318. font-size: 28rpx;
  319. color: #3C3C3C;
  320. padding: 28rpx 24rpx;
  321. border-bottom: 1px solid #EEEEEE;
  322. }
  323. .boxIcon{
  324. width: 26rpx;height: 16rpx;
  325. margin-top: 6rpx;
  326. }
  327. .popupBox{
  328. width: 750rpx;
  329. height: 809rpx;
  330. background: #FFFFFF;
  331. border-radius: 32rpx 32rpx 0rpx 0rpx;
  332. position: fixed;
  333. left: 0;
  334. bottom: 0;
  335. }
  336. .popupTitleBox{
  337. display: flex;
  338. justify-content: space-between;
  339. padding: 30rpx;
  340. }
  341. .popupTitle{
  342. font-size: 30rpx;
  343. color: #3C3C3C;
  344. line-height: 42rpx;
  345. font-weight: 600;
  346. }
  347. .chaImg{
  348. width: 27rpx;height: 27rpx;margin-top: 9rpx;
  349. }
  350. .popupMs{
  351. font-size: 26rpx;
  352. color: #FF8113;
  353. padding-left: 24rpx;
  354. padding-bottom: 20rpx;
  355. border-bottom: 1px solid #EEEEEE;
  356. }
  357. .inputBox{
  358. display: flex;
  359. padding: 0 24rpx;
  360. line-height: 98rpx;
  361. border-bottom: 1px solid #EEEEEE;
  362. }
  363. .iphoneInput{
  364. line-height: 1;
  365. height: 98rpx;
  366. /* padding-left: 40rpx; */
  367. -webkit-text-size-adjust: none;
  368. }
  369. .iphoneInput{
  370. line-height: 98rpx;
  371. }
  372. .pBottom{
  373. position: absolute;
  374. left: 0;
  375. bottom: 0;
  376. width: 750rpx;
  377. padding: 24rpx 0rpx;
  378. background: #FFFFFF;
  379. box-shadow: 0rpx -2rpx 20rpx 0rpx rgba(153,153,153,0.2);
  380. display: flex;
  381. justify-content: space-around;
  382. }
  383. .pBcancel{
  384. width: 331rpx;
  385. border-radius: 37rpx;
  386. border: 2rpx solid #DDDDDD;
  387. padding: 16rpx 0;
  388. text-align: center;
  389. font-weight: 500;
  390. font-size: 28rpx;
  391. color: #3C3C3C;
  392. }
  393. .pBBtn{
  394. width: 331rpx;
  395. padding: 16rpx 0;
  396. background: #FF8113;
  397. border-radius: 37rpx;
  398. text-align: center;
  399. font-weight: 500;
  400. font-size: 28rpx;
  401. color: #FEFFFE;
  402. }
  403. .jiantou{
  404. width: 30rpx;height: 30rpx;
  405. margin-top: 4rpx;
  406. }
  407. .lineRgihtSjh{
  408. display: flex;
  409. }
  410. .delInput{
  411. width: 30rpx;
  412. height: 30rpx;
  413. margin-top: 30rpx;
  414. }
  415. .inputBox{
  416. justify-content: space-between;
  417. }
  418. </style>