user.vue 6.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284
  1. <template>
  2. <view class="container">
  3. <view class="user-info-box">
  4. <view class="detail flex">
  5. <view class="portrait-box"><image class="portrait" :src=" userInfo.avatar || '../../static/error/missing-face.png'"></image></view>
  6. <view class="info-box">
  7. <view class="username">{{userInfo.nickname||"游客"}}</view>
  8. <view class="font-size-sm">{{userInfo.mobile || ''}}</view>
  9. </view>
  10. </view>
  11. <view class="config iconfont"><text class="setting iconsetting" @click="navTo('/pages/set/userinfo')"></text></view>
  12. </view>
  13. <view class="vip-box"><image src="../../static/img/vip.png" mode=""></image></view>
  14. <view class="tt">
  15. <view class="tt-box" @click="navTo('/pages/user/promotion')">
  16. <image src="../../static/img/tuiguang.png" class="tt-icon1" mode=""></image>
  17. <view class="tt-txt">我的推广</view>
  18. <image src="../../static/img/jiantou.png" class="next-icon" mode=""></image>
  19. </view>
  20. <view class="tt-box" @click="navTo('/pages/user/team')">
  21. <image src="../../static/img/team.png" class="tt-icon1" mode=""></image>
  22. <view class="tt-txt">我的团队</view>
  23. <image src="../../static/img/jiantou.png" class="next-icon" mode=""></image>
  24. </view>
  25. <view class="tt-box" @click="navTo('/pages/user/shareQrCode')">
  26. <image src="../../static/img/share.png" class="tt-icon1" mode=""></image>
  27. <view class="tt-txt">分享好友</view>
  28. <image src="../../static/img/jiantou.png" class="next-icon" mode=""></image>
  29. </view>
  30. <view class="tt-box" @click="open()">
  31. <image src="../../static/img/kefu.png" class="tt-icon1" mode=""></image>
  32. <view class="tt-txt">联系客服</view>
  33. <image src="../../static/img/jiantou.png" class="next-icon" mode=""></image>
  34. </view>
  35. </view>
  36. <uni-popup ref="popup" type="center">
  37. <view class="popup-box">
  38. <view class="img"><image src="../../static/img/img009.png" mode=""></image></view>
  39. <view class="mian">
  40. <view class="delivery">
  41. <view class="title">已经为您定制专属客服</view>
  42. <image src="../../static/img/img010.png" mode=""></image>
  43. </view>
  44. <view class="nocancel">客服电话: {{ text }}</view>
  45. <view class="comfirm-box">
  46. <view class="cancel" @click="cancel">取消</view>
  47. <view class="comfirm" @click="comfirm(text)">拨打电话</view>
  48. </view>
  49. </view>
  50. </view>
  51. </uni-popup>
  52. </view>
  53. </template>
  54. <script>
  55. import uniPopup from '@/components/uni-popup/uni-popup.vue';
  56. import uniCopy from '@/utils/uni-copy.js';
  57. import { mapState, mapMutations } from 'vuex';
  58. import { saveUrl, interceptor } from '@/utils/loginUtils.js';
  59. export default {
  60. data() {
  61. return {
  62. text:'123456789'
  63. };
  64. },
  65. computed:{
  66. ...mapState('user', ['userInfo', 'orderInfo', 'hasLogin'])
  67. },
  68. methods: {
  69. navTo(url) {
  70. if (!this.hasLogin) {
  71. // 保存地址
  72. saveUrl();
  73. // 登录拦截
  74. interceptor();
  75. } else {
  76. uni.navigateTo({
  77. url
  78. });
  79. }
  80. },
  81. open() {
  82. console.log('点击出现弹窗');
  83. this.$refs.popup.open();
  84. },
  85. // 客服弹窗 - 取消
  86. cancel() {
  87. this.$refs.popup.close();
  88. }
  89. }
  90. };
  91. </script>
  92. <style lang="scss">
  93. page,
  94. .container {
  95. background: #000;
  96. height: 100%;
  97. }
  98. .user-info-box {
  99. padding: 40rpx 46rpx 0;
  100. height: 180rpx;
  101. color: white;
  102. display: flex;
  103. align-items: center;
  104. justify-content: space-between;
  105. position: relative;
  106. z-index: 1;
  107. .detail {
  108. height: 130rpx;
  109. .portrait-box {
  110. height: 100%;
  111. .portrait {
  112. width: 130rpx;
  113. height: 100%;
  114. border: 5rpx solid #fff;
  115. border-radius: 50%;
  116. }
  117. }
  118. .info-box {
  119. margin-left: 20rpx;
  120. line-height: 1.5;
  121. .username {
  122. font-size: $font-lg + 6rpx;
  123. height: 100%;
  124. }
  125. }
  126. }
  127. .config {
  128. font-size: 48rpx;
  129. }
  130. }
  131. .vip-box {
  132. width: 690rpx;
  133. height: 200rpx;
  134. margin: 60rpx auto 0;
  135. image {
  136. width: 100%;
  137. height: 100%;
  138. }
  139. }
  140. .tt {
  141. margin: 0 auto;
  142. width: 750rpx;
  143. padding: 40rpx 70rpx;
  144. background-color: #000;
  145. .tt-box {
  146. padding: 20rpx;
  147. height: 100rpx;
  148. display: flex;
  149. align-items: center;
  150. border-bottom: 1px solid #838383;
  151. .tt-icon1 {
  152. width: 42rpx;
  153. height: 37rpx;
  154. }
  155. .tt-icon2 {
  156. width: 49rpx;
  157. height: 38rpx;
  158. }
  159. .tt-icon3 {
  160. width: 46rpx;
  161. height: 40rpx;
  162. }
  163. .tt-icon4 {
  164. width: 40rpx;
  165. height: 42rpx;
  166. }
  167. .tt-icon5 {
  168. width: 44rpx;
  169. height: 40rpx;
  170. }
  171. .tt-txt {
  172. font-size: 28rpx;
  173. font-family: PingFang SC;
  174. font-weight: 500;
  175. color: #ffffff;
  176. margin-left: 36rpx;
  177. color: #ffffff;
  178. flex: 1;
  179. }
  180. .next-icon {
  181. width: 16rpx;
  182. height: 25rpx;
  183. }
  184. }
  185. .border-b {
  186. border-bottom: 1px solid #f0f0f0;
  187. }
  188. }
  189. .popup-box {
  190. width: 522rpx;
  191. height: 605rpx;
  192. background-color: #ffffff;
  193. border-radius: 20rpx;
  194. position: relative;
  195. .img {
  196. position: relative;
  197. top: -56rpx;
  198. left: 0;
  199. width: 522rpx;
  200. height: 132rpx;
  201. display: flex;
  202. justify-content: center;
  203. image {
  204. border-radius: 20rpx 20rpx 0 0;
  205. width: 450rpx;
  206. height: 132rpx;
  207. }
  208. }
  209. .mian {
  210. margin-top: -44rpx;
  211. display: flex;
  212. flex-direction: column;
  213. align-items: center;
  214. // padding: 32rpx 32rpx;
  215. background-color: #ffffff;
  216. border-radius: 0 0 20rpx 20rpx;
  217. text-align: center;
  218. .delivery {
  219. font-size: 40rpx;
  220. color: #333333;
  221. display: flex;
  222. align-items: center;
  223. flex-direction: column;
  224. .title {
  225. }
  226. image {
  227. margin-top: 48rpx;
  228. width: 172rpx;
  229. height: 160rpx;
  230. }
  231. }
  232. .nocancel {
  233. font-size: 32rpx;
  234. color: #333333;
  235. margin-top: 14rpx;
  236. }
  237. .comfirm-box {
  238. margin-top: 52rpx;
  239. display: flex;
  240. // margin-bottom: 32rpx;
  241. // justify-content: space-around;
  242. .cancel {
  243. display: flex;
  244. align-items: center;
  245. justify-content: center;
  246. width: 197rpx;
  247. height: 74rpx;
  248. border: 1px solid #dcc786;
  249. border-radius: 38rpx;
  250. font-size: 32rpx;
  251. color: #605128;
  252. }
  253. .comfirm {
  254. margin-left: 32rpx;
  255. display: flex;
  256. align-items: center;
  257. justify-content: center;
  258. width: 197rpx;
  259. height: 74rpx;
  260. background: linear-gradient(-90deg, #d1ba77 0%, #f7e8ad 100%);
  261. border-radius: 38px;
  262. font-size: 32rpx;
  263. color: #605128;
  264. }
  265. }
  266. }
  267. }
  268. </style>