find.vue 2.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091
  1. <template>
  2. <view class="content">
  3. <u-cell-group>
  4. <u-cell-item title="粮友圈" :title-style="{marginLeft:'30rpx',fontWeight:'800'}" @tap="linkToMoment">
  5. <u-icon slot="icon" name="moments" color="#409eff" size="40"></u-icon>
  6. </u-cell-item>
  7. </u-cell-group>
  8. <view style="height: 10rpx;"></view>
  9. <u-cell-group>
  10. <u-cell-item title="扫一扫" :title-style="{marginLeft:'30rpx',fontWeight:'800'}" @tap="linkToScan">
  11. <u-icon slot="icon" name="scan" color="#409eff" size="40"></u-icon>
  12. </u-cell-item>
  13. </u-cell-group>
  14. <view style="height: 10rpx;"></view>
  15. <view class="" v-for="(item,index) in linkItem" :key="index">
  16. <u-cell-group>
  17. <u-cell-item :title="item.title" :title-style="{marginLeft:'30rpx',fontWeight:'800'}" @tap="linkTo(item,index)">
  18. <u-icon slot="icon" :name="item.icon" :color="item.color" size="40"></u-icon>
  19. </u-cell-item>
  20. </u-cell-group>
  21. <view v-if="index!=linkItem.length" class="" style="height: 10rpx;"></view>
  22. </view>
  23. <tarBar :totarBer='tar'></tarBar>
  24. </view>
  25. </template>
  26. <script>
  27. import tarBar from '@/components/tarbar.vue'
  28. export default {
  29. components:{ tarBar },
  30. data() {
  31. return {
  32. tar:{
  33. color:'#07A7E3',
  34. id:3
  35. },
  36. };
  37. },
  38. onShow() {
  39. this.querylinkItem(false)
  40. },
  41. onPullDownRefresh() {
  42. this.querylinkItem(true)
  43. },
  44. methods: {
  45. querylinkItem(freshFlag){
  46. this.$socket.getLinks(this.userData.user.operId, res=>{
  47. this.$u.vuex('linkItem',res.response.data)
  48. if(freshFlag){
  49. uni.stopPullDownRefresh();
  50. }
  51. });
  52. },
  53. linkToMoment(){
  54. this.$u.route({
  55. url:'pageC/firendCircle/firendCircle'
  56. })
  57. },
  58. linkToScan(){
  59. uni.scanCode({
  60. success: function(res) {
  61. uni.vibrateLong();
  62. let uId = res.result
  63. if (uId==t.userData.user.operId){
  64. uni.showToast({
  65. icon:'none',
  66. title:'暂不支持添加自己'
  67. })
  68. } else {
  69. t.$u.route({
  70. url: 'pageC/businessCard/businessCard',
  71. params:{ id: uId, source: 2}
  72. })
  73. }
  74. }
  75. });
  76. },
  77. linkTo(item, index){
  78. this.$u.route({
  79. url:'pageA/webview/webview',
  80. params:{url:item.url,name:item.title}
  81. })
  82. }
  83. }
  84. };
  85. </script>
  86. <style lang="scss" scoped>
  87. .content{
  88. }
  89. </style>