user.vue 1.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263
  1. <template>
  2. <view>
  3. <view class="title">
  4. <u-link href="http://www.uviewui.com">本项目使用uView!</u-link>
  5. </view>
  6. <view class="title">
  7. <u-link href="https://hhyang.cn/src/router/start/quickstart.html">本项目使用uni-simple-router!</u-link>
  8. </view>
  9. <button type="default" @click="toLogin" class="login-button" style="margin-top: 150upx;">前往登录页</button>
  10. <!-- 未登录时会跳转登录页 -->
  11. <button type="default" @click="toOrder" class="login-button">前往订单页</button>
  12. <view>
  13. <u-calendar v-model="show" :mode="mode"></u-calendar>
  14. <u-button @click="show = true" style="width: 260upx;margin-top: 100upx;">打开uView日历</u-button>
  15. </view>
  16. </view>
  17. </template>
  18. <script>
  19. export default {
  20. data() {
  21. return {
  22. show: false,
  23. mode: 'date'
  24. };
  25. },
  26. methods: {
  27. toLogin(){
  28. //跳转传参示例
  29. this.$Router.push({
  30. path: '/pages/login/login',
  31. query: {msg:'我要登录!'}
  32. });
  33. },
  34. toOrder(){
  35. //跳转传参示例
  36. this.$Router.push({
  37. path: '/pages/order/order',
  38. query: {msg:'前往订单!'}
  39. });
  40. }
  41. }
  42. }
  43. </script>
  44. <style lang="scss">
  45. .title{
  46. text-align: center;
  47. margin-top: 100upx;
  48. }
  49. .login-button{
  50. width: 250upx;
  51. margin-top: 20upx;
  52. }
  53. </style>