user.vue 16 KB

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