my.vue 5.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224
  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'>{{userInfo.nickname?userInfo.nickname:'请点击登录'}}</view>
  12. <view v-else> <u--input
  13. placeholder="请输入内容"
  14. border="bottom"
  15. v-model='userInfo.nickname'
  16. clearable
  17. ></u--input></view>
  18. <u-icon v-if='!edit&&userInfo.phone' @click='edit = true' name="edit-pen-fill" color="#2979ff" size="24"></u-icon>
  19. <u-icon v-if='edit&&userInfo.phone' @click='editNickName' name="checkbox-mark" color="#2979ff" size="24"></u-icon>
  20. </view>
  21. <view>{{userInfo.phone1}}</view>
  22. </view>
  23. </view>
  24. <view>
  25. <u-icon name="bell" color="#2979ff" 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
  68. title="我的发布"
  69. isLink
  70. url="/pages/componentsB/badge/badge"
  71. ></u-cell>
  72. <u-cell
  73. title="房源发布"
  74. isLink
  75. url="/pages/componentsB/badge/badge"
  76. ></u-cell>
  77. <u-cell
  78. title="商家入驻"
  79. isLink
  80. url="/pages/componentsB/badge/badge"
  81. ></u-cell>
  82. <u-cell
  83. title="业务合作"
  84. isLink
  85. url="/pages/componentsB/badge/badge"
  86. ></u-cell>
  87. <u-cell
  88. title="广告推广"
  89. isLink
  90. url="/pages/componentsB/badge/badge"
  91. ></u-cell>
  92. <u-cell
  93. title="联系客服"
  94. isLink
  95. url="/pages/componentsB/badge/badge"
  96. ></u-cell>
  97. <u-cell
  98. :border='false'
  99. title="去商家端"
  100. isLink
  101. url="/pageA/enter/enter"
  102. ></u-cell>
  103. </u-cell-group>
  104. </view>
  105. </view>
  106. <login-pop-up ref='loginpopup' :content='"手机登录后才能查看我的哦~"'></login-pop-up>
  107. </view>
  108. </template>
  109. <script>
  110. import loginPopUp from "@/components/loginPopUp/index.vue"
  111. export default {
  112. components: {
  113. loginPopUp
  114. },
  115. data() {
  116. return {
  117. edit:false,
  118. offset:['-2','-27%'],
  119. type:"warning",
  120. value:'88',
  121. title: 'Hello',
  122. userInfo:{},
  123. }
  124. },
  125. onLoad() {
  126. },
  127. onShow(){
  128. if(!uni.getStorageSync("userInfo").phone){
  129. this.$refs.loginpopup.open()
  130. }else{
  131. this.userInfo = uni.getStorageSync("userInfo")
  132. var reg = /1(\d{2})\d{4}(\d{4})/g;
  133. this.userInfo.phone1 = this.userInfo.phone.replace(reg,"1$1****$2");
  134. console.log(this.userInfo)
  135. }
  136. },
  137. methods: {
  138. editNickName(){
  139. this.$request.baseRequest('admin.unimall.commonUserInfo', 'update', {
  140. commonUserInfo:JSON.stringify(this.userInfo)
  141. }, failres => {
  142. uni.showToast({
  143. icon: "none",
  144. title: failres.errmsg,
  145. duration: 3000
  146. });
  147. }).then(res => {
  148. uni.setStorageSync("userInfo",this.userInfo)
  149. this.edit=false
  150. })
  151. },
  152. login(){
  153. if(!uni.getStorageSync("userInfo").phone){
  154. this.$refs.loginpopup.open()
  155. }else{
  156. }
  157. }
  158. }
  159. }
  160. </script>
  161. <style lang='scss' scoped>
  162. .content {
  163. display: flex;
  164. flex-direction: column;
  165. align-items: center;
  166. justify-content: center;
  167. }
  168. .logo {
  169. height: 200rpx;
  170. width: 200rpx;
  171. margin-top: 200rpx;
  172. margin-left: auto;
  173. margin-right: auto;
  174. margin-bottom: 50rpx;
  175. }
  176. .text-area {
  177. display: flex;
  178. justify-content: center;
  179. }
  180. .title {
  181. font-size: 36rpx;
  182. color: #8f8f94;
  183. }
  184. .wrap{
  185. width:92vw;
  186. }
  187. .orderList{
  188. display:flex;
  189. flex-wrap: wrap;
  190. .orderItem{
  191. width:48%;
  192. padding:20rpx;
  193. background:#E5EBFF;
  194. box-sizing:border-box;
  195. margin:5rpx;
  196. border-radius:10rpx;
  197. display:flex;
  198. }
  199. /deep/.u-badge{
  200. z-index:50;
  201. }
  202. .orderName{
  203. margin-left:20rpx;
  204. }
  205. }
  206. .user{
  207. background:#fff;
  208. width:100%;
  209. padding:10rpx 20rpx;
  210. }
  211. .userWrap{
  212. width:92vw;
  213. margin:0 auto;
  214. }
  215. </style>