user.vue 18 KB

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