index.vue 4.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244
  1. <template>
  2. <mobile-frame :frameStyle="frameStyle" @toPath="toPath">
  3. <view class="main">
  4. <view class="one">
  5. <view class="one_1" v-if="!form._id">
  6. <text class="iconfont icon-geren2" @click="toOrrder('logo')"></text>
  7. <view class="name">未登录</view>
  8. </view>
  9. <view class="one_1" v-else>
  10. <image :src="form.icon"></image>
  11. <view class="name">
  12. <text>{{form.name||'暂无'}}</text>
  13. <text>普通会员</text>
  14. </view>
  15. </view>
  16. <view class="one_2">
  17. <view class="one_2_1">
  18. <text v-if="form._id">{{form.collect||0}}</text>
  19. <text @click="toOrrder('收藏的商品')">收藏的商品</text>
  20. </view>
  21. <text class="link">|</text>
  22. <view class="one_2_1">
  23. <text v-if="form._id">{{form.collect||0}}</text>
  24. <text @click="toOrrder('收藏的店铺')">收藏的店铺</text>
  25. </view>
  26. </view>
  27. </view>
  28. <view class="two">
  29. <view class="two_1">
  30. <view class="title">我的订单</view>
  31. <view class="title">
  32. <text @click="toOrrder('我的订单')">全部订单</text>
  33. <text class="iconfont icon-dayufuhao"></text>
  34. </view>
  35. </view>
  36. <view class="two_2">
  37. <view class="orderList" v-for="(item, index) in orderList" :key="index"
  38. @click="toOrrder(item.type)">
  39. <view class="icon">
  40. <text class="iconfont" :class="[item.icon]"></text>
  41. </view>
  42. <text class="title">{{item.title}}</text>
  43. </view>
  44. </view>
  45. <view class="two_1" v-for="(item, index) in menuList" :key="index" @click="toOrrder(item.type)">
  46. <view class="title">{{item.title}}</view>
  47. <view class="title">
  48. <text v-if="form._id&&item.title=='我的积分'">{{form.integral||0}}分</text>
  49. <text v-if="form._id&&item.title=='客服电话'">{{form.phone||'123-345-6780'}}</text>
  50. <text class="iconfont icon-dayufuhao"></text>
  51. </view>
  52. </view>
  53. </view>
  54. </view>
  55. </mobile-frame>
  56. </template>
  57. <script>
  58. export default {
  59. data() {
  60. return {
  61. frameStyle: {
  62. useBar: true
  63. },
  64. form: {},
  65. // 图标菜单
  66. orderList: [{
  67. icon: 'icon-daifukuan',
  68. title: '待付款',
  69. type: 'a'
  70. },
  71. {
  72. icon: 'icon-daifahuo',
  73. title: '待发货',
  74. type: 'b'
  75. },
  76. {
  77. icon: 'icon-daishouhuo',
  78. title: '待收货/消费',
  79. type: 'c'
  80. },
  81. {
  82. icon: 'icon-daipinglun',
  83. title: '待评论',
  84. type: 'd'
  85. },
  86. {
  87. icon: 'icon-shouhoufuwuicon',
  88. title: '售后',
  89. type: 'e'
  90. },
  91. ],
  92. // 菜单
  93. menuList: [{
  94. title: '我的优惠劵',
  95. type: 'f'
  96. },
  97. {
  98. title: '我的积分',
  99. type: 'g'
  100. },
  101. {
  102. title: '我的资产',
  103. type: 'h'
  104. },
  105. {
  106. title: '我的拼团',
  107. type: 'i'
  108. },
  109. {
  110. title: '我的收货地址',
  111. type: 'j'
  112. },
  113. {
  114. title: '账号管理',
  115. type: 'k'
  116. },
  117. {
  118. title: '客服电话',
  119. type: 'l'
  120. },
  121. ],
  122. };
  123. },
  124. onShow: function() {},
  125. methods: {
  126. toPath(e) {
  127. if (e && e.route) uni.redirectTo({
  128. url: `/${e.route}`
  129. })
  130. },
  131. // 跳转页面
  132. toOrrder(e) {
  133. const that = this;
  134. console.log(e);
  135. },
  136. }
  137. }
  138. </script>
  139. <style lang="scss">
  140. .main {
  141. display: flex;
  142. flex-direction: column;
  143. width: 100vw;
  144. height: 100vh;
  145. .one {
  146. text-align: center;
  147. padding: 4vw 0;
  148. background-color: #FB1438;
  149. color: var(--mainColor);
  150. .one_1 {
  151. margin: 0 0 5vw 0;
  152. image {
  153. width: 25vw;
  154. height: 25vw;
  155. border-radius: 25vw;
  156. }
  157. .iconfont {
  158. font-size: 80px;
  159. }
  160. .name {
  161. display: flex;
  162. justify-content: space-evenly;
  163. margin: 2vw 0;
  164. font-size: var(--font18Szie);
  165. }
  166. }
  167. .one_2 {
  168. display: flex;
  169. flex-direction: row;
  170. justify-content: space-around;
  171. font-size: var(--font16Szie);
  172. .one_2_1{
  173. display: flex;
  174. flex-direction: column;
  175. }
  176. .link {
  177. font-weight: bold;
  178. }
  179. }
  180. }
  181. .two {
  182. background-color: var(--f1Color);
  183. .two_1 {
  184. display: flex;
  185. justify-content: space-between;
  186. padding: 4vw;
  187. background-color: var(--mainColor);
  188. margin: 0 0 0.1vw 0;
  189. .title {
  190. font-size: var(--font16Szie);
  191. }
  192. .title:last-child {
  193. color: var(--f85Color);
  194. font-size: var(--font14Size);
  195. }
  196. }
  197. .two_1:nth-last-child(2) {
  198. margin: 0 0 2vw 0;
  199. }
  200. .two_1:nth-last-child(4) {
  201. margin: 0 0 2vw 0;
  202. }
  203. .two_2 {
  204. display: flex;
  205. justify-content: space-between;
  206. padding: 5vw;
  207. background-color: var(--mainColor);
  208. margin: 0 0 2vw 0;
  209. .orderList {
  210. text-align: center;
  211. .icon {
  212. .iconfont {
  213. font-size: 25px;
  214. }
  215. }
  216. .title {
  217. display: inline-block;
  218. margin: 2vw 0 0 0;
  219. font-size: var(--font12Size);
  220. }
  221. }
  222. }
  223. }
  224. }
  225. </style>