custom.vue 9.5 KB

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