custom.vue 10 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403
  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">
  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.remainderMoney}}</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">{{keyongMoney}}</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" src="../../static/img/icon_arrow_up.png" mode=""></image>
  91. </view>
  92. <view v-if="moreShow">
  93. <view class="contLine">
  94. <view class="lineTitle">证件类型</view>
  95. <view class="lineRgiht">{{customerInfo.idType}}</view>
  96. </view>
  97. <view class="contLine">
  98. <view class="lineTitle">证件号码</view>
  99. <view class="lineRgiht">{{customerInfo.idCode}}</view>
  100. </view>
  101. <view class="contLine">
  102. <view class="lineTitle">所在地区</view>
  103. <view class="lineRgiht">{{customerInfo.provinceName}}{{customerInfo.cityName}}{{customerInfo.areaName}}</view>
  104. </view>
  105. <view class="contLine">
  106. <view class="lineTitle">详细地址</view>
  107. <view class="lineRgiht">{{customerInfo.address}}</view>
  108. </view>
  109. <view class="contLine">
  110. <view class="lineTitle">推广员工</view>
  111. <view class="lineRgiht">{{customerInfo.proUserName}}</view>
  112. </view>
  113. <view class="contLine">
  114. <view class="lineTitle">推广客户</view>
  115. <view class="lineRgiht">{{customerInfo.proCustomerName}}</view>
  116. </view>
  117. <view class="contLine" >
  118. <view class="lineTitle">生日</view>
  119. <view class="lineRgiht" v-if="customerInfo">
  120. <span v-if="customerInfo.birthday">{{customerInfo.birthday.slice(0,10)}}</span>
  121. </view>
  122. </view>
  123. <view class="contLine">
  124. <view class="lineTitle">客户备注</view>
  125. <view class="lineRgiht">{{customerInfo.comment}}</view>
  126. </view>
  127. </view>
  128. </view>
  129. <uni-popup ref="popup" type="bottom" >
  130. <view class="popupBox">
  131. <view class="popupTitleBox">
  132. <view class="popupTitle">修改手机号</view>
  133. <image src="../../static/img/cha.png" mode="" @click="pBcancel" class="chaImg"></image>
  134. </view>
  135. <view class="popupMs">此处修改手机号后,将根据新手机号重新匹配客户信息</view>
  136. <view class="inputBox">
  137. <view class="inputMs">手机号</view>
  138. <input type="text" v-model="extUserMobile" class="iphoneInput" placeholder="请输入" />
  139. </view>
  140. <view class="pBottom">
  141. <view class="pBcancel" @click="pBcancel">取消</view>
  142. <view class="pBBtn" @click="extCustomerMobile">确定</view>
  143. </view>
  144. </view>
  145. </uni-popup>
  146. </view>
  147. </template>
  148. <script>
  149. export default {
  150. props:['token'],
  151. data() {
  152. return {
  153. extUserMobile:'',
  154. customerInfo:'',
  155. customerId:'',
  156. unionID:'',
  157. keyongMoney:'',
  158. moreShow:false,
  159. }
  160. },
  161. onLoad() {
  162. },
  163. methods: {
  164. moreBtn(){
  165. this.moreShow=!this.moreShow
  166. },
  167. getdata(){
  168. this.extCustomerInfo()
  169. },
  170. extCustomerInfo(){
  171. var that=this;
  172. this.userId=uni.getStorageSync('userId')
  173. this.$http('enterprise/wechat/extCustomerInfo', {
  174. corpID:'wpMGjbBgAA_zIu6wbKy48zFSbGiGeP8g',
  175. extUserId:this.userId,
  176. token:this.token
  177. }, 'GET').then(res => {
  178. this.customerInfo=res.data.customerInfo
  179. this.customerId=this.customerInfo.id
  180. uni.setStorage({
  181. key: 'customerId',
  182. data: that.customerId,
  183. success: function () { }
  184. });
  185. this.keyongMoney= this.customerInfo.creditMoney - this.customerInfo.stayInMoney
  186. this.keyongMoney.toFixed(2)
  187. })
  188. },
  189. extCustomerMobile(){
  190. var that=this;
  191. uni.showLoading({
  192. title: '加载中'
  193. });
  194. this.userId=uni.getStorageSync('userId')
  195. this.$http('enterprise/wechat/extCustomerMobile', {
  196. corpID:'wpMGjbBgAA_zIu6wbKy48zFSbGiGeP8g',
  197. extUserId: this.userId,
  198. extUserMobile:this.extUserMobile
  199. }, 'POST').then(res => {
  200. uni.hideLoading();
  201. if(res.code!=1){
  202. }else{
  203. uni.showToast({
  204. title: res.data,
  205. icon: 'none',
  206. duration: 3000
  207. });
  208. this.pBcancel()
  209. this.extCustomerInfo()
  210. }
  211. }).catch(err=>{
  212. })
  213. },
  214. editIphone(){
  215. console.log(this.token)
  216. this.$refs.popup.open('bottom')
  217. },
  218. pBcancel(){
  219. this.$refs.popup.close()
  220. }
  221. }
  222. }
  223. </script>
  224. <style scoped>
  225. .contLineBox{
  226. background: #fff;
  227. }
  228. .contLine{
  229. display: flex;
  230. justify-content: space-between;
  231. border-bottom: 1px solid #F6F6F6;
  232. padding: 28rpx 24rpx;
  233. font-size: 28rpx;
  234. }
  235. .lineTitle{
  236. color: #666666;
  237. }
  238. .lineRgiht{
  239. color: #3C3C3C;
  240. }
  241. .lineRgiht2{
  242. color: #FF8113;
  243. }
  244. .titleBox{
  245. display: flex; flex-wrap: wrap;
  246. width: 500rpx;
  247. }
  248. .title{
  249. height: 36rpx;
  250. border-radius: 4rpx;
  251. border: 1px solid #FF8113;
  252. line-height: 34rpx;
  253. font-size: 24rpx;
  254. color: #FF8113;
  255. padding: 0 8rpx;
  256. margin-right: 10rpx;
  257. margin-bottom: 10rpx;
  258. }
  259. .box{
  260. margin-top: 20rpx;background: #fff;
  261. }
  262. .boxTitle{
  263. font-weight: 500;
  264. font-size: 28rpx;
  265. color: #3C3C3C;
  266. padding: 28rpx 24rpx;
  267. border-bottom: 1px solid #EEEEEE;
  268. }
  269. .creditBox{
  270. display: flex;
  271. flex-wrap: wrap;
  272. padding-top: 16rpx;
  273. padding-bottom: 16rpx;
  274. }
  275. .creditLine{
  276. width: 50%;display: flex;
  277. padding-top: 8rpx;
  278. padding-bottom: 8rpx;
  279. font-size: 26rpx;
  280. color: #666666;
  281. }
  282. .creditNum{
  283. color: #3C3C3C;
  284. }
  285. .creditTitle{
  286. padding-left: 24rpx;
  287. }
  288. .boxTitle2{
  289. display: flex;
  290. justify-content: space-between;
  291. font-weight: 500;
  292. font-size: 28rpx;
  293. color: #3C3C3C;
  294. padding: 28rpx 24rpx;
  295. border-bottom: 1px solid #EEEEEE;
  296. }
  297. .boxIcon{
  298. width: 26rpx;height: 16rpx;
  299. margin-top: 6rpx;
  300. }
  301. .popupBox{
  302. width: 750rpx;
  303. height: 809rpx;
  304. background: #FFFFFF;
  305. border-radius: 32rpx 32rpx 0rpx 0rpx;
  306. position: fixed;
  307. left: 0;
  308. bottom: 0;
  309. }
  310. .popupTitleBox{
  311. display: flex;
  312. justify-content: space-between;
  313. padding: 30rpx;
  314. }
  315. .popupTitle{
  316. font-size: 30rpx;
  317. color: #3C3C3C;
  318. line-height: 42rpx;
  319. }
  320. .chaImg{
  321. width: 27rpx;height: 27rpx;margin-top: 9rpx;
  322. }
  323. .popupMs{
  324. font-size: 26rpx;
  325. color: #FF8113;
  326. padding-left: 24rpx;
  327. padding-bottom: 20rpx;
  328. border-bottom: 1px solid #EEEEEE;
  329. }
  330. .inputBox{
  331. display: flex;
  332. padding: 0 24rpx;
  333. line-height: 98rpx;
  334. border-bottom: 1px solid #EEEEEE;
  335. }
  336. .iphoneInput{
  337. line-height: 98rpx;
  338. height: 98rpx;
  339. padding-left: 40rpx;
  340. }
  341. .pBottom{
  342. position: absolute;
  343. left: 0;
  344. bottom: 0;
  345. width: 750rpx;
  346. padding: 24rpx 0rpx;
  347. background: #FFFFFF;
  348. box-shadow: 0rpx -2rpx 20rpx 0rpx rgba(153,153,153,0.2);
  349. display: flex;
  350. justify-content: space-around;
  351. }
  352. .pBcancel{
  353. width: 331rpx;
  354. height: 74rpx;
  355. border-radius: 37rpx;
  356. border: 2rpx solid #DDDDDD;
  357. line-height: 74rpx;
  358. text-align: center;
  359. font-weight: 500;
  360. font-size: 28rpx;
  361. color: #3C3C3C;
  362. }
  363. .pBBtn{
  364. width: 331rpx;
  365. height: 74rpx;
  366. background: #FF8113;
  367. border-radius: 37rpx;
  368. line-height: 74rpx;
  369. text-align: center;
  370. font-weight: 500;
  371. font-size: 28rpx;
  372. color: #FEFFFE;
  373. }
  374. .jiantou{
  375. width: 30rpx;height: 30rpx;
  376. margin-top: 6rpx;
  377. }
  378. .lineRgihtSjh{
  379. display: flex;
  380. }
  381. </style>