my.vue 5.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245
  1. <template>
  2. <view class="content">
  3. <view class='user'>
  4. <view class='flex userWrap justify-space-between'>
  5. <view class='flex'>
  6. <view style='margin-right:20rpx;'>
  7. <u--image width='60' height='60' :src="userInfo.head" shape="circle"></u--image>
  8. </view>
  9. <view>
  10. <view class='flex'>
  11. <view @click='login' v-if='!edit' style="font-weight: bold;font-size: 32rpx;">
  12. {{userInfo.nickname?userInfo.nickname:'请点击登录'}}
  13. </view>
  14. <view v-else> <u--input placeholder="请输入内容" border="bottom" v-model='userInfo.nickname'
  15. clearable></u--input></view>
  16. <u-icon v-if='!edit&&userInfo.phone' @click='edit = true' name="edit-pen-fill"
  17. color="#eaad1a" size="24"></u-icon>
  18. <u-icon v-if='edit&&userInfo.phone' @click='editNickName' name="checkbox-mark"
  19. color="#eaad1a" size="24"></u-icon>
  20. </view>
  21. <view>{{userInfo.phone1}}</view>
  22. </view>
  23. </view>
  24. <view>
  25. <u-icon name="bell" color="#eaad1a" size="28"></u-icon>
  26. </view>
  27. </view>
  28. </view>
  29. <view class="wrap">
  30. <!-- <view class='orderList'>
  31. <view class="orderItem align-item-center">
  32. <view style='position:relative;'>
  33. <u-icon name="home-fill" color="#2979ff" size="28"></u-icon>
  34. <u-badge :offset='offset' absolute='true' bgColor='red' max="99" :value="value"></u-badge>
  35. </view>
  36. <view class='orderName'>入住订单</view>
  37. </view>
  38. <view class="orderItem align-item-center">
  39. <view style='position:relative;'>
  40. <u-icon name="home-fill" color="#2979ff" size="28"></u-icon>
  41. <u-badge :offset='offset' absolute='true' bgColor='red' max="99" :value="value"></u-badge>
  42. </view>
  43. <view class='orderName'>特产订单</view>
  44. </view>
  45. <view class="orderItem align-item-center">
  46. <view style='position:relative;'>
  47. <u-icon name="home-fill" color="#2979ff" size="28"></u-icon>
  48. <u-badge :offset='offset' absolute='true' bgColor='red' max="99" :value="value"></u-badge>
  49. </view>
  50. <view class='orderName'>团购订单</view>
  51. </view>
  52. <view class="orderItem align-item-center">
  53. <view style='position:relative;'>
  54. <u-icon name="home-fill" color="#2979ff" size="28"></u-icon>
  55. <u-badge :offset='offset' absolute='true' bgColor='red' max="99" :value="value"></u-badge>
  56. </view>
  57. <view class='orderName'>门票订单</view>
  58. </view>
  59. </view> -->
  60. <view style='width:100%;'>
  61. <u-cell-group :border='false'>
  62. <!-- <u-cell
  63. title="收货地址"
  64. isLink
  65. url="/pages/componentsB/tag/tag"
  66. ></u-cell> -->
  67. <u-cell title="我的发布" isLink url="/pageA/my/mypublish"></u-cell>
  68. <!-- <u-cell
  69. title="房源发布"
  70. isLink
  71. url="/pages/componentsB/badge/badge"
  72. ></u-cell> -->
  73. <!-- <u-cell
  74. title="商家入驻"
  75. isLink
  76. url="/pages/componentsB/badge/badge"
  77. ></u-cell> -->
  78. <!-- <u-cell
  79. title="业务合作"
  80. isLink
  81. url="/pages/componentsB/badge/badge"
  82. ></u-cell> -->
  83. <!-- <u-cell
  84. title="广告推广"
  85. isLink
  86. url="/pages/componentsB/badge/badge"
  87. ></u-cell> -->
  88. <view class="kf">
  89. <button class="left-btn" open-type='contact'>联系客服</button>
  90. </view>
  91. <u-cell :border='false' title="去商家端" isLink url="/pageA/enter/enter"></u-cell>
  92. </u-cell-group>
  93. </view>
  94. </view>
  95. <login-pop-up ref='loginpopup' :content='"手机登录后才能查看我的哦~"'></login-pop-up>
  96. </view>
  97. </template>
  98. <script>
  99. import loginPopUp from "@/components/loginPopUp/index.vue"
  100. export default {
  101. components: {
  102. loginPopUp
  103. },
  104. data() {
  105. return {
  106. edit: false,
  107. offset: ['-2', '-27%'],
  108. type: "warning",
  109. value: '88',
  110. title: 'Hello',
  111. userInfo: {},
  112. }
  113. },
  114. onLoad() {
  115. },
  116. onShow() {
  117. if (!uni.getStorageSync("userInfo").phone) {
  118. this.$refs.loginpopup.open()
  119. } else {
  120. this.userInfo = uni.getStorageSync("userInfo")
  121. var reg = /1(\d{2})\d{4}(\d{4})/g;
  122. this.userInfo.phone1 = this.userInfo.phone.replace(reg, "1$1****$2");
  123. console.log(this.userInfo)
  124. }
  125. },
  126. methods: {
  127. editNickName() {
  128. this.$request.baseRequest('admin.unimall.commonUserInfo', 'update', {
  129. commonUserInfo: JSON.stringify(this.userInfo)
  130. }, failres => {
  131. uni.showToast({
  132. icon: "none",
  133. title: failres.errmsg,
  134. duration: 3000
  135. });
  136. }).then(res => {
  137. uni.setStorageSync("userInfo", this.userInfo)
  138. this.edit = false
  139. })
  140. },
  141. login() {
  142. if (!uni.getStorageSync("userInfo").phone) {
  143. this.$refs.loginpopup.open()
  144. } else {
  145. }
  146. }
  147. }
  148. }
  149. </script>
  150. <style lang='scss' scoped>
  151. .content {
  152. display: flex;
  153. flex-direction: column;
  154. align-items: center;
  155. justify-content: center;
  156. }
  157. .logo {
  158. height: 200rpx;
  159. width: 200rpx;
  160. margin-top: 200rpx;
  161. margin-left: auto;
  162. margin-right: auto;
  163. margin-bottom: 50rpx;
  164. }
  165. .text-area {
  166. display: flex;
  167. justify-content: center;
  168. }
  169. .title {
  170. font-size: 36rpx;
  171. color: #8f8f94;
  172. }
  173. .wrap {
  174. width: 92vw;
  175. }
  176. .orderList {
  177. display: flex;
  178. flex-wrap: wrap;
  179. .orderItem {
  180. width: 48%;
  181. padding: 20rpx;
  182. background: #E5EBFF;
  183. box-sizing: border-box;
  184. margin: 5rpx;
  185. border-radius: 10rpx;
  186. display: flex;
  187. }
  188. /deep/.u-badge {
  189. z-index: 50;
  190. }
  191. .orderName {
  192. margin-left: 20rpx;
  193. }
  194. }
  195. .user {
  196. background: #fff;
  197. width: 100%;
  198. padding: 10rpx 20rpx;
  199. }
  200. .userWrap {
  201. width: 92vw;
  202. margin: 0 auto;
  203. }
  204. .kf {
  205. border-bottom-width: 1px;
  206. border-bottom-style: solid;
  207. width: 100%;
  208. border-color: #d6d7d9;
  209. padding: 20rpx;
  210. box-sizing: border-box;
  211. }
  212. .left-btn {
  213. padding: 0;
  214. margin: 0;
  215. font-size: 30rpx;
  216. height: 42rpx;
  217. display: flex;
  218. align-items: center;
  219. background-color: #fff;
  220. margin-left: 10rpx;
  221. }
  222. .left-btn:after {
  223. border: none !important;
  224. }
  225. </style>