index.vue 2.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879
  1. <template>
  2. <view :style="{ minHeight: sys.windowHeight + 'px' }" :class="[$tm.vx.state().tmVuetify.black ? 'black' : ' ']">
  3. <tm-menubars title="" :shadow="0" :showback="false"></tm-menubars>
  4. <tm-swiper :previmage="false" :noSwiping="true" width="400" :current="current" :margin="32" :autoplay="false" :list="list"></tm-swiper>
  5. <tm-button theme="white" size="m" @click="shang()">下一张</tm-button>
  6. <tm-button theme="white" size="m" @click="xia()">上一张</tm-button>
  7. <view class="bbb">
  8. <tm-swiper :notouch="true" :disable-touch="true" class="aaa" :current="current1" :autoplay="false" dot-model="rect" :indicator-dots="true" :list="list"></tm-swiper>
  9. </view>
  10. <tm-button theme="white" size="m" @click="shang()">下一张</tm-button>
  11. <tm-button theme="white" size="m" @click="xia()">上一张</tm-button>
  12. </view>
  13. </template>
  14. <script>
  15. import{myRequest} from '@/api/request.js'
  16. export default {
  17. data() {
  18. return {
  19. keyword: '',
  20. top: 60,
  21. sys: null,
  22. list:[
  23. 'https://picsum.photos/800?jv=34',
  24. 'https://picsum.photos/800?jv=74',
  25. 'https://picsum.photos/800?jv=3',
  26. 'https://picsum.photos/800?jv=5',
  27. 'https://picsum.photos/800?jv=74',
  28. 'https://picsum.photos/800?jv=3',
  29. 'https://picsum.photos/800?jv=5'
  30. ],
  31. current:0,
  32. current1:0
  33. };
  34. },
  35. onLoad() {
  36. // #ifdef MP
  37. this.top = uni.upx2px(150);
  38. // #endif
  39. },
  40. created() {
  41. setTimeout(function(){
  42. if(uni.getStorageSync("token")==""){
  43. uni.redirectTo({
  44. url:"/pages/login/index"
  45. })
  46. }
  47. },2000)
  48. this.sys = uni.getSystemInfoSync();
  49. },
  50. methods: {
  51. shang(){
  52. this.current=this.current+1;
  53. this.current1=this.current1+1
  54. },
  55. xia(){
  56. this.current=this.current-1;
  57. this.current1=this.current1-1
  58. }
  59. },
  60. }
  61. </script>
  62. <style lang="scss">
  63. /deep/ .tm-menubars .body{
  64. background-color: #1b1b1b !important;
  65. }
  66. /deep/ .aaa uni-image{
  67. width: 100px !important;
  68. height: 100px !important;
  69. }
  70. /deep/ .aaa uni-swiper-item{
  71. width: 100px !important;
  72. height: 100px !important;
  73. padding: 0 10px !important;
  74. }
  75. </style>