index.vue 1.7 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677
  1. <template>
  2. <view class="page">
  3. <!-- #ifdef H5-->
  4. <uni-nav-bar v-if="!$isWxBrowser()" :fixed="true" background-color="#FFE05C" :border="false" :statusBar="false"
  5. left-icon="left" title="拓客规则" @clickLeft="back"/>
  6. <!-- #endif -->
  7. <view class="flex-col item" v-for="(item,index) in list" :key="index" @click="JumpRules(item)">
  8. <view class="justify-between">
  9. <view>
  10. <view class="phone">{{ item.name }}</view>
  11. </view>
  12. <view >
  13. <uni-icons type="right" color="#979595" size="20"></uni-icons>
  14. </view>
  15. </view>
  16. </view>
  17. <!--#ifdef H5-->
  18. <liu-drag-button v-if="$isWxBrowser()" @clickBtn="back">返回</liu-drag-button>
  19. <!--#endif-->
  20. </view>
  21. </template>
  22. <script>
  23. export default {
  24. data() {
  25. return {
  26. height: '',
  27. list: []
  28. }
  29. },
  30. onLoad(e) {
  31. this.getInfo()
  32. let sysInfo = uni.getSystemInfoSync()
  33. this.height = sysInfo.windowHeight - 120 + 'px' //除标题栏栏外的屏幕可用高度
  34. },
  35. methods: {
  36. back() {
  37. let pages = getCurrentPages()
  38. if (pages.length > 1) {
  39. uni.navigateBack({
  40. delta: 1,
  41. fail: err => {
  42. console.log(err)
  43. }
  44. })
  45. } else {
  46. uni.switchTab({
  47. url: '/pages/my/my'
  48. });
  49. }
  50. },
  51. JumpRules(item){
  52. uni.navigateTo({
  53. url: `/pages/myRules/index?id=${item.id}`
  54. });
  55. },
  56. getInfo() {
  57. this.$api.service.getRoleList().then((res) => {
  58. this.list = res.data.data
  59. })
  60. },
  61. goAddGroup() {
  62. uni.navigateTo({
  63. url: '/pages/addGroup/addGroup'
  64. })
  65. }
  66. }
  67. }
  68. </script>
  69. <style lang="scss" scoped>
  70. @import './index.rpx.css';
  71. </style>