user.vue 18 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537
  1. <template>
  2. <view>
  3. <view :class="'mine' + (skinNotColor ? ' not-color' : '')+(config.greyTheme==1?' grayTheme':'')">
  4. <view :style="'height:' + systems.barHeight + 'rpx;'"></view>
  5. <view
  6. :style="'top:' + systems.ktxStatusHeight + 'rpx;z-index:3;position: absolute;'+'line-height: '+ systems.navigationHeight+'rpx;text-align: center;left: 0;font-size: 34rpx;right: 0;color: #FFFFFF;'">
  7. 我的
  8. </view>
  9. <image src="../../static/pages/images/userBg.png" class="wdbg" @click="jumpUrl('mine/userinfo/userinfo')">
  10. </image>
  11. <view class="minec">
  12. <view class="minec-img" @click="jumpUrl('mine/userinfo/userinfo')">
  13. <image :src="userInfos.avatar ? userInfos.avatar : '/static/pages/images/userimg.png'"
  14. mode="aspectFit" class="user"></image>
  15. </view>
  16. <view class="mines" @click="jumpUrl('mine/userinfo/userinfo')" v-if="isLogin">
  17. <view class="ddflex">
  18. {{ userInfos.nickName }}
  19. <view class="ddflex" style="font-size: 24rpx;font-weight: 400;" @click.stop="isShowBind=true" v-if="userInfos.userType!=1">
  20. <image style="width: 23rpx;height: 22rpx;margin-right: 10rpx;" src="/static/images/bind.png" class="auth-img"></image>
  21. 绑定工号
  22. </view>
  23. <view class="ddflex" style="font-size: 24rpx;font-weight: 400;" v-if="userInfos.userType==1&&userInfos.saleNo">
  24. <image style="width: 23rpx;height: 22rpx;margin-right: 10rpx;" src="/static/images/bind.png" class="auth-img"></image>
  25. {{ userInfos.saleNo }}
  26. </view>
  27. </view>
  28. <text class="edu" v-if="userInfos.mobile">{{ userInfos.mobile }}</text>
  29. </view>
  30. <view class="flex" v-else><text class="login-btn" @click="jumpUrl('')">点击登录</text></view>
  31. <view class="rule dflex" @click="isSign == 0 || sign == 1 ? jumpUrl('') : signFun()" v-if="isShowSign">
  32. <image src="/static/pages/images/qdico.png"></image>
  33. {{ !isLogin ? '签到' : isSign == 0 || sign == 1 ? '已签到' : '签到' }}
  34. </view>
  35. <!-- </navigator> -->
  36. </view>
  37. <view class="datas dflex">
  38. <!-- @click="jumpUrl('mine/coupons/coupons')" -->
  39. <navigator url="" hover-class="none" class="li" @click="jumpUrl('mine/collect/collect')">
  40. <text>{{ myCount.matchNo ? myCount.matchNo : '0' }}</text>
  41. 我的收藏
  42. </navigator>
  43. <navigator url="" hover-class="none" class="li" @click="jumpUrl('mine/follow/index')">
  44. <text>{{ myCount.followNo ? myCount.followNo : '0' }}</text>
  45. 我的关注
  46. </navigator>
  47. <navigator url="" hover-class="none" class="li"
  48. @click="jumpUrl('match/activity/activity')">
  49. <text>{{ myCount.enlistMatchNo ? myCount.enlistMatchNo : '0' }}</text>
  50. 参与活动
  51. </navigator>
  52. <!-- <navigator url="/mine/footprint/footprint" hover-class="none" class="li"><text>{{footprint?footprint:'0'}}</text>足迹</navigator> -->
  53. </view>
  54. <view style="height: 80rpx;"></view>
  55. </view>
  56. <view :class="(config.greyTheme==1?' grayTheme':'')">
  57. <view class="con" style="margin-top: -80rpx;" v-if="userInfos.userType!=1">
  58. <view class="order">
  59. <navigator url="" hover-class="none" class="tits dflex" @click="jumpUrl('match/activity/activity')">
  60. <view class="flex">我的活动</view>
  61. 全部活动
  62. <image src="../../static/pages/images/more.png" class="rico"></image>
  63. </navigator>
  64. <view class="ddflex" style="justify-content: space-between;padding: 40rpx 0rpx;">
  65. <view class="order-item ddflex fflex" @click="jumpUrl('match/activity/activity?current=2')">
  66. <image src="/static/images/hd_dcy.png"></image>
  67. <view>待参与</view>
  68. </view>
  69. <vieW class="order-line"></vieW>
  70. <view class="order-item ddflex fflex" @click="jumpUrl('match/activity/activity?current=3')">
  71. <image src="/static/images/hd_ywc.png"></image>
  72. <view>已完成</view>
  73. </view>
  74. </view>
  75. </view>
  76. </view>
  77. <view class="con" style="margin-top: -80rpx;" v-else>
  78. <view class="order">
  79. <view class="ddflex" style="justify-content: space-between;padding: 40rpx 0rpx;">
  80. <!-- <view class="order-item ddflex fflex" @click="jumpUrl('match/activityManage/activityManage')">
  81. <image src="/static/images/hdgl.png"></image>
  82. <view>活动管理</view>
  83. </view>
  84. <vieW class="order-line"></vieW> -->
  85. <view class="order-item ddflex fflex" @click="jumpUrl('library/poster/index')">
  86. <image src="/static/images/hbtg.png"></image>
  87. <view>海报推广</view>
  88. </view>
  89. <vieW class="order-line"></vieW>
  90. <view class="order-item ddflex fflex" @click="jumpUrl('library/page/page')">
  91. <image src="/static/images/yxdy.png"></image>
  92. <view>营销单页</view>
  93. </view>
  94. </view>
  95. </view>
  96. </view>
  97. <view class="con" v-if="!userInfos.userType&&recommendCard">
  98. <view class="order">
  99. <navigator url="" hover-class="none" class="tits dflex" @click="jumpUrl('mine/order/order')">
  100. <view class="flex">我的顾问</view>
  101. </navigator>
  102. <view class="service-person">
  103. <view class="dflex" @click="jumpUrl('/card/index/index')">
  104. <image class="service-person-header" :src="recommendCard.avatar?recommendCard.avatar:'../../static/pages/images/userimg.png'"></image>
  105. <view class="fflex">
  106. <view class="dflex">
  107. <view class="fflex">
  108. <view class="service-person-name ddflex">
  109. <view>Hi~我是{{recommendCard.realName}}</view>
  110. <image src="/static/images/rico2.png" class="rico"></image>
  111. </view>
  112. <view class="service-person-number">(工号:{{recommendCard.jobNumber}}) 您的1V1专属保险顾问</view>
  113. </view>
  114. <view class="service-person-btn" @click="jumpSingleChatRoom()">在线咨询</view>
  115. </view>
  116. <view class="service-person-options ddflex">
  117. <view class="service-person-option ddflex">
  118. <image src="/static/pages/images/dz_hui.png"></image>
  119. <view>{{recommendCard.favorableComment}}%</view>
  120. </view>
  121. <view class="service-person-option ddflex">
  122. <image src="/static/pages/images/cy_hui.png"></image>
  123. <view>入司{{recommendCard.inDate?monthDayDiff(recommendCard.inDate):'1年'}}</view>
  124. </view>
  125. <view class="service-person-option ddflex">
  126. <image src="/static/pages/images/fw_hui.png"></image>
  127. <view>为{{recommendCard.cntCust?recommendCard.cntCust:0}}人服务</view>
  128. </view>
  129. </view>
  130. </view>
  131. </view>
  132. <view class="service-person-phone ddflex">
  133. <view class="ddflex flex" style="justify-content: center;" @click.stop="callPhone(recommendCard.phone)">
  134. <image src="/static/pages/images/phone1.png"></image>
  135. <view>联系电话</view>
  136. </view>
  137. <view class="order-line" v-if="recommendCard.phone&&recommendCard.wechat"></view>
  138. <view class="ddflex flex" style="justify-content: center;" @click.stop="isShowCodePop=true">
  139. <image style="width: 35rpx;height: 28rpx;" src="/static/pages/images/qw.png"></image>
  140. <view>加微信</view>
  141. </view>
  142. </view>
  143. </view>
  144. </view>
  145. </view>
  146. <!-- url="/promote/invite/invite" -->
  147. <view class="box mlist" v-if="userInfos.userType!=1">
  148. <button class="li ddflex" open-type="share">
  149. <image src="/static/images/yqhy.png" class="mico"></image>
  150. <view class="fflex">推荐好友</view>
  151. <image src="../../static/pages/images/more.png" class="rico"></image>
  152. </button>
  153. </view>
  154. <view class="box mlist" v-else>
  155. <navigator class="li ddflex" @click="toCard()" hover-class="none">
  156. <image src="/static/images/wdmp.png" class="mico"></image>
  157. <view class="fflex">我的名片</view>
  158. <image src="../../static/pages/images/more.png" class="rico"></image>
  159. </navigator>
  160. </view>
  161. <view class="box mlist">
  162. <view class="li ddflex">
  163. <view class="fflex">
  164. <contact-button class-name="ddflex" img-url="/static/images/lxkf.png"
  165. img-style='width: 49rpx;height: 49rpx;margin: 0 25rpx 0 0;' button-text="联系客服"
  166. styles="line-height:initial;"></contact-button>
  167. </view>
  168. <image src="../../static/pages/images/more.png" class="rico"></image>
  169. </view>
  170. <navigator class="li ddflex" url="/mine/help/help" hover-class="none">
  171. <image src="/static/images/bzzx.png" class="mico" mode="aspectFit"></image>
  172. <view class="fflex">帮助中心</view>
  173. <image src="../../static/pages/images/more.png" class="rico"></image>
  174. </navigator>
  175. <navigator class="li ddflex" url="/mine/feedback/feedback" hover-class="none">
  176. <image src="/static/images/jyfk.png" class="mico"></image>
  177. <view class="fflex">建议与反馈</view>
  178. <image src="../../static/pages/images/more.png" class="rico"></image>
  179. </navigator>
  180. <navigator class="li ddflex" url="/pages/about/about" hover-class="none">
  181. <image src="/static/images/gywm.png" class="mico"></image>
  182. <view class="fflex">关于中国人寿</view>
  183. <image src="../../static/pages/images/more.png" class="rico"></image>
  184. </navigator>
  185. <navigator class="li ddflex" url="/mine/set/set" hover-class="none">
  186. <image src="/static/images/setting.png" class="mico"></image>
  187. <view class="fflex">设置中心</view>
  188. <image src="../../static/pages/images/more.png" class="rico"></image>
  189. </navigator>
  190. </view>
  191. </view>
  192. <!-- <footer-copyright></footer-copyright> -->
  193. <view style="height: 80rpx;"></view>
  194. <!-- <view class="placeholder-view" :style="'height:' + (bottomBlankHeignt + 115) + 'rpx'"></view> -->
  195. <foot channel="user"></foot>
  196. <to-userinfo v-if="isShowUpdate"></to-userinfo>
  197. <msgNumber bottom="230rpx"></msgNumber>
  198. <view class="ceng2" v-if="isShowCodePop" @click="isShowCodePop = false" @touchmove.stop.prevent="moveHandle"></view>
  199. <view class="code-pop" v-if="isShowCodePop">
  200. <view class="code-content" v-if="recommendCard.wechatCode">
  201. <image :src="recommendCard.wechatCode?recommendCard.wechatCode:'/static/images/wxCode.jpg'" show-menu-by-longpress="true"></image>
  202. <view style="text-align: center;font-size: 24rpx;color: #999;margin-bottom: 50rpx;">长按识别微信二维码</view>
  203. </view>
  204. <view class="code-text" v-else>
  205. <view>微信号</view>
  206. <view>{{recommendCard.wechat}}</view>
  207. </view>
  208. <view class="code-btn" @click="copy(recommendCard.wechat)">
  209. 复制微信号
  210. </view>
  211. </view>
  212. <bindJobnum v-if="isShowBind" @closeBind="closeBind()"></bindJobnum>
  213. </view>
  214. </template>
  215. <script>
  216. // pages/user/user.js
  217. const app = getApp();
  218. const req = require('../../utils/request.js');
  219. const util = require('../../utils/util.js');
  220. const route = require('../../utils/route');
  221. import foot from '../../components/nav-bar/index';
  222. import footerCopyright from '../../components/footer-copyright/footer-copyright';
  223. import bindJobnum from '../../components/bind-jobnum/index.vue';
  224. import msgNumber from '../../components/msg-number/index.vue';
  225. export default {
  226. data() {
  227. return {
  228. systems: {},
  229. skinNotColor: req.public.skinNotColor,
  230. picUrlss: req.public.picUrls,
  231. bottomBlankHeignt: app.globalData.isIPhoneX ? 68 : 0,
  232. // merchantId: '',
  233. iconSrc: req.public.iconSrc,
  234. //头部页面背景链接
  235. isHideVip: true,
  236. //隐藏会员
  237. isVip: true,
  238. //是否是会员
  239. IS_secondary_members: 0,
  240. distr: '',
  241. userinfovip: '',
  242. userMoney: '',
  243. istetphone: '',
  244. logo: '',
  245. name: '',
  246. is_open_wallet: '',
  247. Open_Points_Mall: '',
  248. statistics: '',
  249. vipList: '',
  250. rongkang: req.header.appId,
  251. isSign: '',
  252. sign: 0,
  253. isLogin: false,
  254. noLogin: false,
  255. is_open_shop: '',
  256. isShowSign: false, //是否显示签到按钮
  257. config: {},
  258. userInfo: {},
  259. userInfos: {},
  260. isShowUpdate: false, //是否显示更新信息弹窗
  261. recommendCard:'',
  262. isShowCodePop:false,
  263. isShowBind:false,
  264. myCount:{
  265. enlistMatchNo:0,
  266. followNo:0,
  267. matchNo:0
  268. }
  269. };
  270. },
  271. components: {
  272. foot,
  273. footerCopyright,
  274. bindJobnum,
  275. msgNumber
  276. },
  277. props: {},
  278. onLoad(options) {
  279. uni.hideTabBar();
  280. uni.setNavigationBarColor({
  281. frontColor: this.skinNotColor ? '#000' : '#ffffff',
  282. backgroundColor: this.skinNotColor ? '#fff' : req.public.titleTopBgColor
  283. });
  284. if (JSON.parse(req.getStorage('configRes')).IS_secondary_members) {
  285. let IS_secondary_members = JSON.parse(req.getStorage('configRes')).IS_secondary_members;
  286. console.log(IS_secondary_members);
  287. this.setData({
  288. IS_secondary_members: IS_secondary_members
  289. });
  290. }
  291. this.userInfo = req.getStorage('userInfo');
  292. // #ifdef MP-WEIXIN
  293. let userInfo = req.getStorage('userInfo');
  294. if (req.isAuth()) {
  295. setTimeout(res => {
  296. this.isShowUpdate = true;
  297. }, 500);
  298. }
  299. // #endif
  300. req.saveBehaviorNew('',16,4)
  301. },
  302. onShow: function() {
  303. let userInfo = req.getStorage('userInfo');
  304. this.isLogin = req.isLogins(false);
  305. if (this.isLogin) {
  306. this.getMy();
  307. this.getAbout();
  308. this.getMyCount()
  309. this.noLogin = true;
  310. console.log("userInfo",userInfo)
  311. if(this.isShowUpdate == true){
  312. this.isShowUpdate = false;
  313. }
  314. } else {
  315. this.noLogin = false;
  316. }
  317. },
  318. onShareAppMessage(res) {
  319. if (res.from == 'button') {
  320. let userInfo = req.getStorage('userInfo');
  321. return {
  322. title: userInfo.nickName+'邀请您加入'+this.config.CONFIG_PROJECT_TITLE,
  323. path: '/pages/index/index',
  324. imageUrl: this.config.CONFIG_PROJECT_LOGO, // 分享图
  325. };
  326. }
  327. },
  328. methods: {
  329. jumpUrl(url) {
  330. if (req.isLogins(true)) {
  331. app.globalData.navigateTo(url);
  332. }
  333. },
  334. jumpMerchantManage() {
  335. let token = req.getStorage('AUTH_TOKEN');
  336. this.jumpUrl('merchant/index?appId=' + req.header.appId + '&token=' + token);
  337. },
  338. gouserInfo() {
  339. app.globalData.navigateTo('mine/userinfo/userinfo');
  340. },
  341. getMy() {
  342. let that = this;
  343. req.getRequest('/api/user/info', {}, data => {
  344. // data.merchantId = req.getStorage('userInfo').merchantId
  345. data.nickName = req.excludeSpecial(data.nickName);
  346. this.userInfos = data;
  347. // that.setData(data); // this.isbindmobile();
  348. console.log('userinfo==' + JSON.stringify(data));
  349. this.getRecommendCard()
  350. // console.log(this);
  351. });
  352. },
  353. getAbout() {
  354. var _this = this;
  355. req.getRequest('/api/other/config', {}, function(res) {
  356. _this.phone = res.CONFIG_SERVICE_HOT_MOBILE;
  357. _this.config = res;
  358. _this.setData({
  359. istetphone: res.user_bind_mobile,
  360. logo: res.CONFIG_PROJECT_LOGO,
  361. name: res.CONFIG_PROJECT_TITLE
  362. });
  363. // console.log(res);
  364. if (res && res.is_open_wallet) {
  365. _this.setData({
  366. is_open_wallet: JSON.parse(res.is_open_wallet)
  367. });
  368. }
  369. if (res.is_open_shop) {
  370. _this.is_open_shop = res.is_open_shop;
  371. }
  372. });
  373. },
  374. callPhone() {
  375. if (req.isLogins(true)) {
  376. uni.makePhoneCall({
  377. phoneNumber: this.phone
  378. });
  379. }
  380. },
  381. goUrl() {
  382. app.globalData.openPage('mine/vip/vip');
  383. },
  384. showInfo(index) {
  385. if (!this.vipList[index].isShowInfo) {
  386. this.vipList.map(it => {
  387. it.isShowInfo = false;
  388. return it;
  389. });
  390. }
  391. this.vipList[index].isShowInfo = !this.vipList[index].isShowInfo;
  392. },
  393. closeUpdate() {
  394. this.isShowUpdate = false;
  395. },
  396. updateInfo(e) {
  397. this.isUpdateInfo = e;
  398. this.getMy();
  399. },
  400. updateMobile(e) {
  401. this.isUpdateMobile = e;
  402. this.getMy();
  403. },
  404. closeBind(){
  405. this.isShowBind = false;
  406. },
  407. // 判断强制绑定手机号
  408. // isbindmobile() {
  409. // if (req.getStorage('configRes')) {
  410. // let configRes = JSON.parse(req.getStorage('configRes'))
  411. // this.setData({ istetphone: configRes.user_bind_mobile, logo: configRes.CONFIG_PROJECT_LOGO, name: configRes.CONFIG_PROJECT_TITLE })
  412. // } else {
  413. // req.g('/api/config', (res) => {
  414. // req.setStorage('configRes', JSON.stringify(res))
  415. // this.setData({ istetphone: res.user_bind_mobile, logo: res.CONFIG_PROJECT_LOGO, name: res.CONFIG_PROJECT_TITLE })
  416. // })
  417. // }
  418. // if(this.data.istetphone=='1'){
  419. // // 获取用户手机号
  420. // let userInfo= req.getStorage('userInfo')
  421. // if(userInfo.mobile==null||userInfo.mobile==''){
  422. // console.log("获取用户手机号===============================")
  423. // app.openPage('pages/authorize/authorize?bindmobile=1')
  424. // }
  425. // }
  426. // },
  427. // 获取推荐销售
  428. getRecommendCard(){
  429. if(this.userInfos.userType==1){
  430. req.getRequest('/api/visiting/card/userInfo',{},res=>{
  431. this.recommendCard = res
  432. })
  433. }else{
  434. if(this.userInfos.manageSaleNo){
  435. req.getRequest('/api/visiting/card/recommendCardInfo',{},res=>{
  436. this.recommendCard = res
  437. })
  438. }else{
  439. this.recommendCard = ''
  440. }
  441. }
  442. },
  443. monthDayDiff(date){
  444. return util.monthDayDiff(date)
  445. },
  446. // 拨打电话
  447. callPhone(val) {
  448. if(!val) return false
  449. uni.makePhoneCall({
  450. phoneNumber: val
  451. });
  452. },
  453. copy(val){
  454. this.isShowCodePop = false
  455. uni.setClipboardData({
  456. data: val,
  457. complete() {
  458. req.msg('复制成功')
  459. }
  460. })
  461. },
  462. jumpSingleChatRoom() {
  463. if (this.recommendCard) {
  464. req.jumpSingleChatRoom(this.recommendCard.userId, this.recommendCard.avatar, this.recommendCard
  465. .realName);
  466. req.saveBehaviorNew(this.recommendCard.id,1,14)
  467. }
  468. },
  469. getMyCount(){
  470. req.getRequest('/api/my/count',{},res=>{
  471. this.myCount = res
  472. })
  473. },
  474. toCard(){
  475. if(this.recommendCard){
  476. if(this.recommendCard.auditState==0){
  477. // 待审核
  478. this.jumpUrl('card/success/success?state=0')
  479. return false
  480. }else if(this.recommendCard.auditState==1){
  481. // 审核成功
  482. this.jumpUrl('card/success/success?state=1')
  483. return false
  484. }else if(this.recommendCard.auditState==2){
  485. // 审核失败
  486. this.jumpUrl('card/success/success?state=2&&msg='+this.recommendCard.auditFailReason)
  487. return false
  488. }
  489. }else{
  490. this.jumpUrl('card/create/create')
  491. }
  492. }
  493. },
  494. created() {
  495. const systemInfo = uni.getSystemInfoSync();
  496. // px转换到rpx的比例
  497. let pxToRpxScale = 750 / systemInfo.windowWidth;
  498. let systems = {
  499. ktxStatusHeight: systemInfo.statusBarHeight * pxToRpxScale, // 状态栏的高度
  500. navigationHeight: 44 * pxToRpxScale // 导航栏的高度
  501. };
  502. systems.barHeight = systems.ktxStatusHeight + systems.navigationHeight;
  503. this.systems = systems;
  504. }
  505. };
  506. </script>
  507. <style>
  508. @import './user.css';
  509. </style>