my-login.vue 6.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273
  1. <template>
  2. <view class="home-page">
  3. <view class="head">
  4. <image src="/static/home/BG.jpg" class="bgImg"></image>
  5. <view class="top-info">
  6. <view class="avatar">
  7. <image src="https://mmbiz.qpic.cn/mmbiz/icTdbqWNOwNRna42FI242Lcia07jQodd2FJGIYQfG0LAJGFxM4FbnQP6yfMxBgJ0F3YRqJCJ1aPAK2dQagdusBZg/0"></image>
  8. </view>
  9. <view class="user-info" style="transform: translateX(-20%)">
  10. <view class="username" @click="navigateToLoginPage">{{ "登录" }}</view>
  11. <view class="vip-info" style="opacity: 0">4月会员特权已到期,去续费</view>
  12. </view>
  13. <view class="setting" @click="navigateToSettingPage">
  14. <!-- <image src="/static/setting.png"></image>-->
  15. <van-icon name="setting-o" size="25"></van-icon>
  16. </view>
  17. </view>
  18. <view class="first-panel">
  19. <view class="panel-item">
  20. <van-icon name="star-o" size="25"></van-icon>
  21. <text>收藏</text>
  22. </view>
  23. <view class="panel-item">
  24. <van-icon name="balance-o" size="25"></van-icon>
  25. <text>红包</text>
  26. </view>
  27. <view class="panel-item">
  28. <van-icon name="paid" size="25"></van-icon>
  29. <text>卡券</text>
  30. </view>
  31. <view class="panel-item">
  32. <van-icon name="cash-o" size="25"></van-icon>
  33. <text>余额</text>
  34. </view>
  35. </view>
  36. </view>
  37. \ <view class="panel-list" style="margin-top: 20px ;transform: translateY(68%)">
  38. <!-- 第2个面板 -->
  39. <view class="panel">
  40. <view class="panel-title" style="font-family: 'Montserrat', sans-serif;font-weight: bolder">我的订单</view>
  41. <view class="panel-body">
  42. <view class="panel-item" @click="toOrders(StaticState().ORDER.UNPAY)">
  43. <van-icon name="gold-coin-o" size="28"/>
  44. <text>代付款</text>
  45. </view><view class="panel-item" @click="toOrders(StaticState().ORDER.UNRECEIVE)">
  46. <van-icon name="gift-card-o" class="icon" size="30"/>
  47. <text>代收货</text>
  48. </view><view class="panel-item" @click="toOrders(StaticState().ORDER.REFUND)">
  49. <van-icon name="cash-back-record-o" class="icon" size="29"/>
  50. <text>退款/退货</text>
  51. </view><view class="panel-item" @click="toOrders(StaticState().ORDER.UNCOMMENT)">
  52. <van-icon name="records-o" class="icon" size="26"/>
  53. <text>待评价</text>
  54. </view>
  55. </view>
  56. </view>
  57. <!-- 第3个面板 -->
  58. <view class="panel">
  59. <view class="panel-list-item">
  60. <text>收货地址</text>
  61. <van-icon type="arrowright" size="15"></van-icon>
  62. </view>
  63. <view class="panel-list-item">
  64. <text>联系客服</text>
  65. <van-icon type="arrowright" size="15"></van-icon>
  66. </view>
  67. <view class="panel-list-item" @click="logout">
  68. <text>退出登录</text>
  69. <van-icon type="arrowright" size="15"></van-icon>
  70. </view>
  71. </view>
  72. </view>
  73. </view>
  74. </template>
  75. <script>
  76. import {mapState,mapMutations,mapGetters} from 'vuex'
  77. const defaultAvatarUrl = 'https://mmbiz.qpic.cn/mmbiz/icTdbqWNOwNRna42FI242Lcia07jQodd2FJGIYQfG0LAJGFxM4FbnQP6yfMxBgJ0F3YRqJCJ1aPAK2dQagdusBZg/0'
  78. import {StaticState} from "@/store/StaticState";
  79. export default {
  80. name: "my-login",
  81. data() {
  82. return {
  83. };
  84. },
  85. computed: {
  86. },
  87. methods: {
  88. StaticState,
  89. navigateToSettingPage() {
  90. uni.navigateTo({
  91. url: '/subpkg/setting/setting'
  92. })
  93. },
  94. navigateToLoginPage() {
  95. uni.navigateTo({
  96. url: '/subpkg/login/login'
  97. })
  98. },
  99. ...mapGetters('m_user', ['getUserName','getAvatarUrl']),
  100. test() {
  101. console.log(1, "test");
  102. },
  103. beforeMount() {
  104. console.log(1, "beforeMount");
  105. },
  106. toOrders(pagetype) {
  107. // console.log('----------------------')
  108. // console.log(this.StaticState)
  109. // console.log(this.StaticState.ORDER)
  110. // console.log('toLogin')
  111. let self =this
  112. console.log(pagetype,"这是我传参的参数")
  113. uni.navigateTo({
  114. url: '/subpkg/order/order?pagetype=' + pagetype ,// 跳转至 subpkg 中的 selShop 页面
  115. success() {
  116. console.log('url跳转成功')
  117. setTimeout(() => {
  118. }, 500); // 延迟 1000 毫秒(即 1 秒)后调用 getToken() 函数
  119. },
  120. fail() {
  121. console.log('url跳转失败')
  122. }
  123. });
  124. }
  125. }
  126. };
  127. </script>
  128. <style lang="scss">
  129. .bgImg{
  130. position: absolute;
  131. width: 100%;
  132. //left: 2.5%;
  133. //top: 1%;
  134. }
  135. .panel-list{
  136. padding: 0 10px;
  137. position: relative;
  138. top: -10px;
  139. .panel{
  140. background-color: white;
  141. border-radius: 10px;
  142. margin-bottom: 8px;
  143. .panel-title{
  144. line-height: 40px;
  145. padding-left: 10px;
  146. font-size: 15px;
  147. border-bottom: 1px solid #f4f4f4;
  148. }
  149. .panel-body{
  150. display: flex;
  151. justify-content: space-around;
  152. .panel-item{
  153. display: flex;
  154. flex-direction: column;
  155. align-items: center;
  156. justify-content: space-around;
  157. padding: 10px 0;
  158. font-size: 13px;
  159. .icon{
  160. width: 35px;
  161. height: 35px;
  162. }
  163. }
  164. }
  165. }
  166. //.panel:nth-child(1){
  167. // margin-top: 10px;
  168. // border-radius: 10px;
  169. //}
  170. }
  171. .panel-list-item{
  172. display: flex;
  173. justify-content: space-between;
  174. align-items: center;
  175. font-size: 15px;
  176. padding: 0 10px;
  177. line-height: 45px;
  178. }
  179. .home-page {
  180. .head {
  181. position: relative;
  182. .bgImg {
  183. top: 0;
  184. width: 100%;
  185. height: 400rpx;
  186. }
  187. .top-info {
  188. position: absolute;
  189. top: 60rpx;
  190. left: 30rpx;
  191. right: 30rpx;
  192. display: flex;
  193. align-items: center;
  194. justify-content: space-between;
  195. .avatar {
  196. image {
  197. width: 120rpx;
  198. height: 120rpx;
  199. border-radius: 50%;
  200. }
  201. }
  202. .user-info {
  203. .username {
  204. font-size: 36rpx;
  205. font-weight: bold;
  206. }
  207. .vip-info {
  208. font-size: 24rpx;
  209. color: #999;
  210. }
  211. }
  212. .setting {
  213. image {
  214. width: 50rpx;
  215. height: 50rpx;
  216. }
  217. }
  218. }
  219. .first-panel {
  220. position: absolute;
  221. bottom: -350rpx;
  222. left: 50%;
  223. transform: translateX(-50%);
  224. //transform: translateY(50%);
  225. display: flex;
  226. justify-content: space-around;
  227. width: 95%;
  228. background-color: #fff;
  229. border-radius: 20rpx;
  230. padding: 20rpx 0;
  231. box-shadow: 0 0 10rpx rgba(0, 0, 0, 0.1);
  232. .panel-item {
  233. display: flex;
  234. flex-direction: column;
  235. align-items: center;
  236. font-size: 24rpx;
  237. image {
  238. width: 50rpx;
  239. height: 50rpx;
  240. }
  241. text {
  242. margin-top: 10rpx;
  243. }
  244. }
  245. }
  246. }
  247. }
  248. </style>