index.vue 18 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583
  1. <template>
  2. <view >
  3. <view>
  4. <view class=" u-flex padding " style="position: relative;">
  5. <image style="position: absolute;top: 42rpx;right: 32rpx;width: 48rpx;height: 48rpx;" src="../../static/images/index/setting.png" mode="" @click="goNav('/my/setting/index')"></image>
  6. <view class="u-m-r-10">
  7. <image :src="avatar" style="width: 100rpx;height: 100rpx;border-radius: 100rpx;"
  8. @click="goNav('/pages/my/userinfo')"></image>
  9. <view style="position: absolute; top: 6rpx; left: 90rpx;z-index: 9;"
  10. v-if="isVip&&XCXIsSelect !='否'">
  11. <image src="../../static/images/vp.png" style="width: 25px;height:24px;"></image>
  12. </view>
  13. </view>
  14. <view class="u-flex-1 u-m-l-10" v-if="!isLogin">
  15. <view>
  16. <view class="u-font-18 margin-left-sm margin-top-xs text-bold" style="font-weight: 800;font-size: 32rpx;color: #222222">{{userName}}</view>
  17. <view class="u-font-15 margin-left-sm margin-top-xs" style="font-size: 28rpx;color: #AAAAAA;">ID:{{invitationCode}}</view>
  18. </view>
  19. </view>
  20. <view v-else class="text-xl u-p-l-20 text-bold" @click="goLogin('/pages/public/login')">
  21. 登录
  22. </view>
  23. </view>
  24. <view class="padding-lr margin-lr"
  25. style="background: linear-gradient( 118deg, #525264 0%, #1D233C 100%);;border-radius: 32rpx 32rpx 0px 0px;;height: 178rpx;position: relative;"
  26. v-if="XCXIsSelect != '否' && hyCheck != '否'">
  27. <!-- <image src="../../static/images/my/bg.png" style="width: 100%;height: 110rpx;" mode=""></image> -->
  28. <image src="@/static/images/my/huiyuan.png" style="width: 80rpx;height: 80rpx;position: absolute;top: -40rpx;right: 0;"></image>
  29. <view class="flex justify-between align-center" style="padding-top: 48rpx;">
  30. <view v-if="!isVip" class="vipttl flex align-center"><image src="@/static/images/my/vip-icon.png" style="width: 30rpx;height: 30rpx;margin-right: 16rpx;"></image>开通会员立享会员折扣价</view>
  31. <view v-if="isVip" class="vipttl">会员中心</view>
  32. <!-- <view class="flex-sub text-26 margin-left-xs" style="color: #8A6931;">会员可享贵族福利</view> -->
  33. <view v-if="!isVip" class="btn-bg" @click="goNav('/my/vip/index')">立即开通
  34. </view>
  35. <view v-if="isVip" class="btn-bg" @click="goNav('/my/vip/index')">会员特权
  36. </view>
  37. </view>
  38. </view>
  39. </view>
  40. <view style="margin: -30rpx 32rpx 30rpx;background: #fff;border-radius: 32rpx;padding: 28rpx;position: relative;z-index: 9;">
  41. <view class="title">我的订单</view>
  42. <view class="flex justify-around text-center">
  43. <view class=" padding-tb" @click="goNavOrder(1)">
  44. <image src="../../static/images/my/order1.png" style="width:60upx;height: 60upx;" mode="">
  45. </image>
  46. <view class="text-df" style="line-height: 50upx;">待付款</view>
  47. </view>
  48. <!-- <view class=" padding-tb" @click="goNavOrder(2)">
  49. <image src="../../static/images/my/order6.png" style="width: 60upx;height: 60upx;" mode="">
  50. </image>
  51. <view class="text-df" style="line-height: 50upx;">待确认</view>
  52. </view> -->
  53. <view class=" padding-tb" @click="goNavOrder(2)">
  54. <image src="../../static/images/my/order2.png" style="width: 60upx;height: 60upx;" mode="">
  55. </image>
  56. <view class="text-df" style="line-height: 50upx;">待服务</view>
  57. </view>
  58. <view class=" padding-tb" @click="goNavOrder(6)">
  59. <image src="../../static/images/my/order3.png" style="width: 60upx;height: 60upx;" mode="">
  60. </image>
  61. <view class="text-df" style="line-height: 50upx;">待评价</view>
  62. </view>
  63. <view class=" padding-tb" @click="goNavOrder(8)">
  64. <image src="../../static/images/my/order4.png" style="width: 60upx;height: 60upx;" mode="">
  65. </image>
  66. <view class="text-df" style="line-height: 50upx;">已完成</view>
  67. </view>
  68. </view>
  69. </view>
  70. <image src="/static/image/icon_kefu.png"
  71. class="kefu_view" @click="goChat"></image>
  72. <view class="box">
  73. <view class="title" style="margin: 28rpx 0 0 28rpx;">推荐工具</view>
  74. <view class="flex text-center flex-wrap">
  75. <view class="padding-tb-sm" @click="goNav('/my/wallet/index')" v-if="XCXIsSelect != '否'"
  76. style="width: 25%;">
  77. <image src="../../static/images/my/money.png" style="width: 60rpx;height: 60rpx;" mode=""></image>
  78. <view class="text-df" style="line-height: 50upx;">我的钱包</view>
  79. </view>
  80. <view class="padding-tb-sm" @click="goNav('/my/gird/shoucang')" style="width: 25%;">
  81. <image src="../../static/images/my/shoucang.png" style="width: 60rpx;height: 60rpx;" mode="">
  82. </image>
  83. <view class="text-df" style="line-height: 50upx;">我的收藏</view>
  84. </view>
  85. <view class="padding-tb-sm" @click="goNav('/my/hongbao/youhuijuan')" v-if="XCXIsSelect != '否'"
  86. style="width: 25%;">
  87. <image src="../../static/images/my/youhuijuan.png" style="width: 60rpx;height: 60rpx;" mode="">
  88. </image>
  89. <view class="text-df" style="line-height: 50upx;">优惠券</view>
  90. </view>
  91. <view class="padding-tb-sm" @click="bindFb()" v-if="XCXIsSelect != '否'" style="width: 25%;">
  92. <image src="../../static/images/my/ruzhu.png" style="width: 60rpx;height: 60rpx;" mode=""></image>
  93. <view class="text-df" style="line-height: 50upx;">成为按摩师</view>
  94. </view>
  95. <!-- <view class="padding-tb-sm" @click="goChat" style="width: 25%;">
  96. <image src="../../static/images/my/kefu.png" style="width: 60rpx;height: 60rpx;" mode=""></image>
  97. <view class="text-df" style="line-height: 50upx;">在线客服</view>
  98. </view> -->
  99. <!-- <view class="padding-tb-sm" @click="goNav('/my/feedback/index')" style="width: 25%;">
  100. <image src="../../static/images/my/yijian.png" style="width: 60rpx;height: 60rpx;" mode=""></image>
  101. <view class="text-df" style="line-height: 50upx;">意见反馈</view>
  102. </view> -->
  103. <!-- <view class="padding-tb-sm" @click="goNav('/my/order/tousuList')" style="width: 25%;">
  104. <image src="../../static/images/my/mytousu.png" style="width: 60rpx;height: 60rpx;" mode=""></image>
  105. <view class="text-df" style="line-height: 50upx;">我的投诉</view>
  106. </view> -->
  107. <view v-if="isShop == 1" class="padding-tb-sm" @click="goNav('/my/gonghui/index')" style="width: 25%;">
  108. <image src="../../static/images/my/gonghui.png" style="width: 60rpx;height: 60rpx;"></image>
  109. <view class="text-df" style="line-height: 50upx;">我的商户</view>
  110. </view>
  111. <view class="padding-tb-sm" @click="goNav('/pages/my/myteam')" style="width: 25%;"
  112. v-if="isAgency == 1 && tgCheck != '否'">
  113. <image src="../../static/images/my/myteam.png" style="width: 60rpx;height: 60rpx;" mode=""></image>
  114. <view class="text-df" style="line-height: 50upx;">我的团队</view>
  115. </view>
  116. <view class="padding-tb-sm" @click="goNav('/pages/my/invitationUser')" style="width: 25%;">
  117. <image src="../../static/images/my/myyao.png" style="width: 60rpx;height: 60rpx;" mode=""></image>
  118. <view class="text-df" style="line-height: 50upx;">分享好友</view>
  119. </view>
  120. <view class="padding-tb-sm" @click="goNav('/pages/my/cooperation')" style="width: 25%;"
  121. v-if="isAgency != 1 && tgCheck != '否'">
  122. <image src="../../static/images/my/mydl.png" style="width: 60rpx;height: 60rpx;" mode=""></image>
  123. <view class="text-df" style="line-height: 50upx;">成为代理商</view>
  124. </view>
  125. <view class="padding-tb-sm" @click="goNav('/my/address/address')" style="width: 25%;">
  126. <image src="../../static/images/my/yijian.png" style="width: 60rpx;height: 60rpx;" mode=""></image>
  127. <view class="text-df" style="line-height: 50upx;">地址管理</view>
  128. </view>
  129. <view class="padding-tb-sm" @click="goNav('/my/help/feedbackIndex')" style="width: 25%;">
  130. <image src="../../static/images/my/help.png" style="width: 60rpx;height: 60rpx;" mode=""></image>
  131. <view class="text-df" style="line-height: 50upx;">帮助中心</view>
  132. </view>
  133. <!-- <view class="padding-tb-sm" @click="goNav('/my/setting/index')" style="width: 25%;">
  134. <image src="../../static/images/my/set.png" style="width: 60rpx;height: 60rpx;" mode=""></image>
  135. <view class="text-df" style="line-height: 50upx;">设置中心</view>
  136. </view> -->
  137. <!-- #ifndef H5 -->
  138. <view class="padding-tb-sm" @click="goNav('/pages/my/jinji')" style="width: 25%;">
  139. <image src="../../static/images/my/set1.png" style="width: 60rpx;height: 60rpx;" mode=""></image>
  140. <view class="text-df" style="line-height: 50upx;">紧急求助</view>
  141. </view>
  142. <!-- #endif -->
  143. </view>
  144. </view>
  145. </view>
  146. </template>
  147. <script>
  148. export default {
  149. data() {
  150. return {
  151. isShop: 0,
  152. hyCheck: '否',
  153. tgCheck: '否',
  154. isAgency: 0,
  155. avatar: '../../static/logo.png',
  156. isLogin: true,
  157. userName: '匿名',
  158. browse: 0, //浏览数
  159. fans: 0, //粉丝数
  160. follow: 0, //关注数
  161. visitor: 0, //访客数
  162. userId: '',
  163. isVip: false,
  164. invitationCode: '', //邀请码
  165. list: [{
  166. image: '',
  167. title: '',
  168. url: ''
  169. }, {
  170. image: '',
  171. title: '我的收藏',
  172. url: ''
  173. }, {
  174. image: '',
  175. title: '',
  176. url: ''
  177. }, {
  178. image: '',
  179. title: '成为按摩师',
  180. url: ''
  181. }, {
  182. image: '',
  183. title: '联系客服',
  184. url: ''
  185. }, {
  186. image: '',
  187. title: '意见反馈',
  188. url: ''
  189. },
  190. // {
  191. // image: '',
  192. // title: '帮助中心',
  193. // url: ''
  194. // },
  195. {
  196. image: '',
  197. title: '设置中心',
  198. url: ''
  199. }, {
  200. image: '',
  201. title: '退出登录',
  202. url: ''
  203. }
  204. ],
  205. renzheng: 0,
  206. XCXIsSelect: '否',
  207. }
  208. },
  209. onLoad() {
  210. this.XCXIsSelect = this.$queue.getData("XCXIsSelect");
  211. },
  212. onShow() {
  213. this.hyCheck = this.$queue.getData('hyCheck');
  214. this.tgCheck = this.$queue.getData('tgCheck');
  215. this.userId = uni.getStorageSync('userId')
  216. if (this.userId) {
  217. this.isLogin = false
  218. this.getUserInfo()
  219. this.getAmount()
  220. this.getIsVip()
  221. } else {
  222. this.isShop = 0;
  223. this.isAgency = 0;
  224. this.isLogin = true
  225. this.userName = '匿名'
  226. this.browse = 0
  227. this.fans = 0
  228. this.follow = 0
  229. this.visitor = 0
  230. this.avatar = '../../static/logo.png'
  231. this.isVip = false
  232. }
  233. },
  234. methods: {
  235. goChat() {
  236. let kefu = this.$queue.getData('kefu'); // 用户端联系方式 1 手机号 2企业微信
  237. let kefuPhone = this.$queue.getData('kefuPhone');
  238. if (kefu == 1) {
  239. uni.makePhoneCall({
  240. phoneNumber: kefuPhone //仅为示例
  241. });
  242. } else if (kefu == 3) {
  243. uni.navigateTo({
  244. url: '/my/setting/customer'
  245. });
  246. } else {
  247. // #ifdef MP-WEIXIN
  248. let that = this
  249. try {
  250. wx.openCustomerServiceChat({
  251. extInfo: {
  252. url: that.$queue.getData('kefuUrl')
  253. },
  254. corpId: that.$queue.getData('kefuAppId'),
  255. success(res) {},
  256. fail(res) {
  257. console.error(res)
  258. }
  259. })
  260. } catch (error) {
  261. console.error("catchcatch" + error)
  262. uni.showToast({
  263. title: '请更新至微信最新版本'
  264. });
  265. }
  266. // #endif
  267. // #ifndef MP-WEIXIN
  268. let url = this.$queue.getData('kefuUrl');
  269. if (url.indexOf('/pages/') !== -1 || url.indexOf('/my/') !== -1) {
  270. uni.navigateTo({
  271. url
  272. });
  273. } else {
  274. //#ifndef H5
  275. uni.navigateTo({
  276. url: '/pages/index/webView?url=' + url
  277. });
  278. //#endif
  279. //#ifdef H5
  280. window.location.href = url;
  281. //#endif
  282. }
  283. // #endif
  284. }
  285. },
  286. //退出登录
  287. TuiLogin() {
  288. let that = this
  289. if (that.userId) {
  290. uni.showModal({
  291. title: '提示',
  292. content: '确定退出登录吗?',
  293. success: function(res) {
  294. if (res.confirm) {
  295. console.log('用户点击确定');
  296. uni.removeStorageSync('userName')
  297. uni.removeStorageSync('avatar')
  298. uni.removeStorageSync('userId')
  299. uni.removeStorageSync('token')
  300. uni.removeStorageSync('phone')
  301. uni.removeStorageSync('zhiFuBaoName')
  302. uni.removeStorageSync('zhiFuBao')
  303. uni.removeStorageSync('invitationCode')
  304. uni.removeStorageSync('unionId')
  305. uni.removeStorageSync('openId')
  306. uni.removeStorageSync('isVIP')
  307. uni.showToast({
  308. title: '退出成功!',
  309. icon: 'none'
  310. })
  311. that.isLogin = true
  312. that.userName = '匿名'
  313. that.browse = 0
  314. that.fans = 0
  315. that.follow = 0
  316. that.visitor = 0
  317. that.isVip = false
  318. that.avatar = '../../static/logo.png'
  319. that.userId = uni.getStorageSync('userId')
  320. } else if (res.cancel) {
  321. console.log('用户点击取消');
  322. }
  323. }
  324. })
  325. } else {
  326. uni.showModal({
  327. title: '提示',
  328. content: '您还未登录,请先登录',
  329. success: function(res) {
  330. if (res.confirm) {
  331. console.log('用户点击确定');
  332. uni.navigateTo({
  333. url: '/pages/public/login'
  334. })
  335. } else if (res.cancel) {
  336. console.log('用户点击取消');
  337. }
  338. }
  339. })
  340. }
  341. },
  342. //成为按摩师 跳转商户端
  343. bindFb() {
  344. if (this.userId) {
  345. uni.navigateTo({
  346. url: '/pages/my/hehuo'
  347. });
  348. } else {
  349. uni.showModal({
  350. title: '提示',
  351. content: '您还未登录,请先登录',
  352. success: function(res) {
  353. if (res.confirm) {
  354. console.log('用户点击确定');
  355. uni.navigateTo({
  356. url: '/pages/public/login'
  357. })
  358. } else if (res.cancel) {
  359. console.log('用户点击取消');
  360. }
  361. }
  362. })
  363. }
  364. },
  365. goNavOrder(index) {
  366. let token = this.$queue.getData('token');
  367. if (token) {
  368. this.$queue.setData('SelectIndex', index);
  369. uni.switchTab({
  370. url: '/pages/order/index'
  371. })
  372. } else {
  373. uni.showModal({
  374. title: '提示',
  375. content: '您还未登录,请先登录',
  376. success: function(res) {
  377. if (res.confirm) {
  378. console.log('用户点击确定');
  379. uni.navigateTo({
  380. url: '/pages/public/login'
  381. })
  382. } else if (res.cancel) {
  383. console.log('用户点击取消');
  384. }
  385. }
  386. })
  387. }
  388. },
  389. goNav(e, name) {
  390. console.log(e)
  391. if (this.userId) {
  392. uni.navigateTo({
  393. url: e
  394. })
  395. } else {
  396. uni.showModal({
  397. title: '提示',
  398. content: '您还未登录,请先登录',
  399. success: function(res) {
  400. if (res.confirm) {
  401. console.log('用户点击确定');
  402. uni.navigateTo({
  403. url: '/pages/public/login'
  404. })
  405. } else if (res.cancel) {
  406. console.log('用户点击取消');
  407. }
  408. }
  409. })
  410. }
  411. },
  412. goLogin(e) {
  413. uni.navigateTo({
  414. url: e
  415. })
  416. },
  417. getAmount() {
  418. this.$Request.get("/app/userBrowse/selectAmount").then(res => {
  419. if (res.code == 0) {
  420. this.browse = res.data.browse
  421. this.fans = res.data.fans
  422. this.follow = res.data.follow
  423. this.visitor = res.data.visitor
  424. }
  425. });
  426. },
  427. getUserInfo() {
  428. this.$Request.get("/app/user/selectUserById").then(res => {
  429. if (res.code == 0) {
  430. this.userName = res.data.userName
  431. this.invitationCode = res.data.invitationCode
  432. this.avatar = res.data.avatar ? res.data.avatar : '../../static/logo.png'
  433. this.isAuthentication = res.data.isAuthentication
  434. this.isAgency = res.data.isAgency ? res.data.isAgency : 0; //是否是推广员 1是 2否
  435. // uni.setStorageSync('isAuthentication', res.data.isAuthentication)
  436. this.isShop = res.data.isShop ? res.data.isShop : 0;
  437. uni.setStorageSync('avatar', res.data.avatar)
  438. uni.setStorageSync('userName', res.data.userName)
  439. uni.setStorageSync('invitationCode', res.data.invitationCode)
  440. uni.setStorageSync('zhiFuBao', res.data.zhiFuBao)
  441. uni.setStorageSync('zhiFuBaoName', res.data.zhiFuBaoName)
  442. if (res.data.isAuthentication == 0 || res.data.isAuthentication == null) {
  443. this.renzheng = 0
  444. uni.setStorageSync("renzheng", this.renzheng)
  445. } else if (res.data.isAuthentication == 1) {
  446. this.renzheng = 1
  447. uni.setStorageSync("renzheng", this.renzheng)
  448. } else if (res.data.isAuthentication == 2) {
  449. this.renzheng = 2
  450. uni.setStorageSync("renzheng", this.renzheng)
  451. } else if (res.data.isAuthentication == 3) {
  452. this.renzheng = 3
  453. uni.setStorageSync("renzheng", this.renzheng)
  454. } else if (res.data.isAuthentication == 4) {
  455. this.renzheng = 4
  456. uni.setStorageSync("renzheng", this.renzheng)
  457. } else if (res.data.isAuthentication == 5) {
  458. this.renzheng = 5
  459. uni.setStorageSync("renzheng", this.renzheng)
  460. } else if (res.data.isAuthentication == 6) {
  461. this.renzheng = 6
  462. uni.setStorageSync("renzheng", this.renzheng)
  463. }
  464. }
  465. });
  466. // #ifdef APP-PLUS
  467. let clientid = plus.push.getClientInfo().clientid;
  468. let sysPhone = 1;
  469. if (plus.os.name.toLowerCase() === 'android') {
  470. sysPhone = 1;
  471. } else {
  472. sysPhone = 2;
  473. }
  474. let userId = this.$queue.getData('userId');
  475. if (userId) {
  476. this.$Request.postT('/app/user/updateClientId?clientId=' + clientid + '&userId=' + userId +
  477. '&sysPhone=' + sysPhone).then(
  478. res => {});
  479. }
  480. //#endif
  481. },
  482. getIsVip() {
  483. this.$Request.get("/app/UserVip/isUserVip").then(res => {
  484. if (res.code == 0) {
  485. this.isVip = res.data
  486. uni.setStorageSync('isVIP', res.data)
  487. }
  488. });
  489. }
  490. }
  491. }
  492. </script>
  493. <style lang="scss" scoped>
  494. page {
  495. background: linear-gradient( 180deg, #FFE5ED 0%, #F6F6F6 400rpx);
  496. }
  497. .text-df{
  498. font-size: 24rpx;
  499. color: #222222;
  500. margin-top: 14rpx;
  501. }
  502. .kefu_view {
  503. width: 100rpx;
  504. height: 100rpx;
  505. position: fixed;
  506. right: 30rpx;
  507. bottom: 200rpx;
  508. }
  509. .bg {
  510. background: #05C25C;
  511. }
  512. .title{
  513. font-size: 32rpx;
  514. font-weight: bold;
  515. color: #222222;
  516. }
  517. .box {
  518. background: #FFFFFF;
  519. color: #333333;
  520. margin: 30rpx 32rpx;
  521. border-radius: 32rpx;
  522. padding-top: 1rpx;
  523. }
  524. .camera {
  525. width: 54px;
  526. height: 44px;
  527. &:active {
  528. background-color: #ededed;
  529. }
  530. }
  531. .btn-bg {
  532. width: 160rpx;
  533. height: 64rpx;
  534. line-height: 64rpx;
  535. text-align: center;
  536. background: linear-gradient( 145deg, #FFEACE 0%, #FEC186 100%);
  537. border-radius: 36rpx 36rpx 36rpx 36rpx;
  538. border: 2rpx solid rgba(0,0,0,0);
  539. font-weight: bold;
  540. font-size: 28rpx;
  541. color: #BB5D1E;
  542. }
  543. .images {
  544. width: 18rpx;
  545. height: 30rpx;
  546. }
  547. .vipttl {
  548. font-weight: bold;
  549. font-size: 32rpx;
  550. color: #F0D4C1;
  551. font-family: PingFang SC, PingFang SC;
  552. }
  553. </style>