user.vue 17 KB

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