user.vue 5.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214
  1. <template>
  2. <view class="pageBg">
  3. <view class="page-header">
  4. <view class="contain">
  5. <view class="page-header-content">
  6. <view class="page-header-content-left">
  7. <view class="" @click="onInfo">
  8. <u-avatar :src="src" size="100"></u-avatar>
  9. <!-- :src="userdata ? userdata.avatarUrl : null" -->
  10. </view>
  11. </view>
  12. <view class="page-header-content-center">
  13. <view>
  14. <view class="fz16px mt5px">{{userdata && userdata.nickName ? userdata.nickName : '22222'}}
  15. </view>
  16. </view>
  17. </view>
  18. </view>
  19. </view>
  20. <!-- 订单 -->
  21. <view class="mt20px">
  22. <view class="contain">
  23. <view class="box">
  24. <u-row justify="center">
  25. <u-col span="8">
  26. <view class="">我的订单</view>
  27. </u-col>
  28. <u-col span="4">
  29. <view class="text-right" @click="openPage('/pages/order/myOrder/myOrder?type=0');">
  30. <text class="fz14px" style="color: #96989e;">全部订单</text>
  31. <view style="display: inline-block;">
  32. <u-icon name="arrow-right" color="#96989e" size="24"></u-icon>
  33. </view>
  34. </view>
  35. </u-col>
  36. </u-row>
  37. <view class="flex-box mt20px">
  38. <view class="flex-box-item" @click="openPage('/pages/order/myOrder/myOrder?type=1')">
  39. <u-icon name="rmb-circle" labelColor="#96989e" labelPos="bottom" labelSize="14px"
  40. label="待付款" size="40"></u-icon>
  41. </view>
  42. <view class="flex-box-item" @click="openPage('/pages/order/myOrder/myOrder?type=2')">
  43. <u-icon name="clock" labelColor="#96989e" label="待核销" labelSize="14px" labelPos="bottom"
  44. size="40"></u-icon>
  45. </view>
  46. <view class="flex-box-item" @click="openPage('/pages/order/myOrder/myOrder?type=3')">
  47. <u-icon name="close-circle" label="已取消" labelColor="#96989e" labelSize="14px"
  48. labelPos="bottom" size="40"></u-icon>
  49. </view>
  50. <view class="flex-box-item" @click="openPage('/pages/order/myOrder/myOrder?type=4')">
  51. <u-icon name="bag" label="已完成" labelColor="#96989e" labelSize="14px" labelPos="bottom"
  52. size="40"></u-icon>
  53. </view>
  54. </view>
  55. </view>
  56. </view>
  57. </view>
  58. </view>
  59. <view class="mt20px">
  60. <view class="contain mt20px">
  61. <view class="box mt20px">
  62. <view class="mb10px">我的应用</view>
  63. <view class="flex-box mt20px">
  64. <view class="flex-box-item" @click="openPage('/pages/user/myInfo')">
  65. <u-icon name="account" labelColor="#96989e" labelPos="bottom" labelSize="14px" label="个人信息"
  66. size="40"></u-icon>
  67. </view>
  68. <view class="flex-box-item" @click="openPage(`/pages/diningCar/diningCar?id=${cList.id}`)">
  69. <u-icon name="car" labelColor="#96989e" label="餐车信息" labelSize="14px" labelPos="bottom"
  70. size="40"></u-icon>
  71. </view>
  72. <view class="flex-box-item" @click="call">
  73. <u-icon name="kefu-ermai" label="客服电话" labelColor="#96989e" labelSize="14px"
  74. labelPos="bottom" size="40"></u-icon>
  75. </view>
  76. </view>
  77. </view>
  78. <!-- <u-button type="error" @click="exitMP()">退出登录</u-button> -->
  79. </view>
  80. </view>
  81. </view>
  82. </template>
  83. <script>
  84. import iAvg from '../../static/avg.png'
  85. export default {
  86. data() {
  87. return {
  88. userdata: {
  89. avg: '../../static/avg.png',
  90. phone: '',
  91. nickName: ''
  92. },
  93. src: iAvg,
  94. cPhone: '',
  95. cList: {}
  96. }
  97. },
  98. onLoad() {
  99. const e = uni.getStorageSync('info')
  100. this.cPhone = e
  101. this.fatchDate()
  102. const q = uni.getStorageSync('carl')
  103. this.cList = q
  104. },
  105. methods: {
  106. openPage(path) {
  107. this.$u.route({
  108. url: path
  109. })
  110. },
  111. fatchDate() {
  112. wx.getUserInfo({
  113. success: (res) => {
  114. console.log(res)
  115. this.userdata = res.userInfo
  116. console.log(res.userInfo)
  117. }
  118. })
  119. },
  120. call() {
  121. console.log('eeeeeeeeeeeeeeee===============', this.cPhone)
  122. if (this.cPhone.customerPhone) {
  123. uni.makePhoneCall({
  124. phoneNumber: this.cPhone.customerPhone
  125. })
  126. } else {
  127. uni.showToast({
  128. icon: 'none',
  129. title: '暂无商家电话'
  130. })
  131. }
  132. },
  133. onInfo() {
  134. uni.navigateTo({
  135. url: `/pages/user/myInfo`
  136. });
  137. }
  138. }
  139. }
  140. </script>
  141. <style lang="scss">
  142. .page-header {
  143. width: 100%;
  144. display: inline-block;
  145. padding-top: 60rpx;
  146. background-size: cover;
  147. background-position: left;
  148. background-repeat: no-repeat;
  149. background-image: linear-gradient(to bottom, #FBBD69, #F97023);
  150. height: 35vh;
  151. &-content {
  152. display: flex;
  153. flex-direction: column; // 设置 Flex 方向为垂直
  154. align-items: center; // 水平居中子元素
  155. justify-content: center; // 垂直居中子元素
  156. &-left {
  157. margin-right: 20rpx;
  158. .avator {
  159. display: inline-block;
  160. border: 2px solid #fff;
  161. border-radius: 50%;
  162. }
  163. }
  164. &-center {
  165. flex: 1;
  166. color: #fff;
  167. }
  168. &-right {
  169. width: 60rpx;
  170. }
  171. }
  172. }
  173. .box {
  174. padding: 30rpx;
  175. border-radius: 20rpx;
  176. background-color: #fff;
  177. }
  178. .flex-box {
  179. display: flex;
  180. text-align: center;
  181. background-color: #F1F3F8;
  182. border-radius: 10rpx;
  183. &-item {
  184. flex: 1;
  185. margin: 10px;
  186. position: relative;
  187. .line {
  188. height: 70%;
  189. width: 1px;
  190. background-color: #ebebeb;
  191. position: absolute;
  192. right: 0;
  193. top: 50%;
  194. transform: translateY(-50%);
  195. }
  196. }
  197. }
  198. .pageBg {
  199. background-color: #EFF2F7
  200. }
  201. </style>