find.vue 2.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384
  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. </view>
  24. </template>
  25. <script>
  26. export default {
  27. data() {
  28. return {
  29. };
  30. },
  31. onShow() {
  32. this.querylinkItem(false)
  33. },
  34. onPullDownRefresh() {
  35. this.querylinkItem(true)
  36. },
  37. methods: {
  38. querylinkItem(freshFlag){
  39. this.$socket.getLinks(this.userData.user.operId, res=>{
  40. this.$u.vuex('linkItem',res.response.data)
  41. if(freshFlag){
  42. uni.stopPullDownRefresh();
  43. }
  44. });
  45. },
  46. linkToMoment(){
  47. this.$u.route({
  48. url:'pages/firendCircle/firendCircle'
  49. })
  50. },
  51. linkToScan(){
  52. uni.scanCode({
  53. success: function(res) {
  54. uni.vibrateLong();
  55. let uId = res.result
  56. if (uId==t.userData.user.operId){
  57. uni.showToast({
  58. icon:'none',
  59. title:'暂不支持添加自己'
  60. })
  61. } else {
  62. t.$u.route({
  63. url: 'pages/businessCard/businessCard',
  64. params:{ id: uId, source: 2}
  65. })
  66. }
  67. }
  68. });
  69. },
  70. linkTo(item, index){
  71. this.$u.route({
  72. url:'pages/webview/webview',
  73. params:{url:item.url,name:item.title}
  74. })
  75. }
  76. }
  77. };
  78. </script>
  79. <style lang="scss" scoped>
  80. .content{
  81. }
  82. </style>