game.vue 6.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199
  1. <template>
  2. <view class="page">
  3. <uni-list class="item-list">
  4. <uni-list-item title="生活圈" class="item-list-item"
  5. :show-arrow="true"
  6. :show-badge="true"
  7. badge-type="error"
  8. :showArrow="true"
  9. width="42rpx"
  10. height="42rpx"
  11. :badge-text="show_tips"
  12. thumb="/static/theme/default/push/circle.png"
  13. @click="goPath('../push/circle')"/>
  14. <uni-list-item title="扫一扫"
  15. :show-arrow="false"
  16. :show-badge="false"
  17. width="42rpx"
  18. height="34rpx"
  19. badge-type="error"
  20. :showArrow="true"
  21. thumb="/static/theme/default/push/scan.png"
  22. @click="goScanCode"/>
  23. <!--自定义网址-->
  24. <!-- <uni-list-item :title="item.appName" v-if="list.length" v-for="(item,index) in list"
  25. :show-arrow="false"
  26. :show-badge="false"
  27. badge-type="error"
  28. :showArrow="true"
  29. :thumb="domainUrl +item.logo_url"
  30. @click="goPath('web?url='+item.url+'&title='+item.appName+'&agent_user_id='+item.agent_user_id )"/> -->
  31. </uni-list>
  32. </view>
  33. </template>
  34. <script>
  35. import _hook from '../../common/_hook';
  36. import _data from '../../common/_data';
  37. import _get from '../../common/_get';
  38. import uniList from '../../components/uni-ui/uni-list/uni-list.vue';
  39. import uniListItem from '../../components/uni-ui/uni-list-item/uni-list-item.vue';
  40. import _page from '../../common/common';
  41. export default {
  42. components: {
  43. uniList,
  44. uniListItem
  45. },
  46. data () {
  47. return {
  48. list:[],
  49. show_tips:''
  50. }
  51. },
  52. onShow () {
  53. let _this = this;
  54. uni.getLocation({
  55. type: 'wgs84 ',
  56. success: function (res) {
  57. console.log('经度:' + res.longitude);
  58. console.log('纬度:' + res.latitude);
  59. },
  60. fail:function(err){
  61. console.log(err)
  62. }
  63. });
  64. _hook.routeTabBarHook();
  65. _get.getOnlineList({},function (res) {
  66. _this.list = res
  67. });
  68. let num = _data.data('no_reader_circle_chat_num');
  69. /** 监听朋友圈动态提示 */
  70. uni.$on('data_circle_tips', function (data) {
  71. _this.show_tips = data;
  72. });
  73. if (num) {
  74. this.show_tips = num;
  75. } else if (_data.data('no_reader_circle')) {
  76. this.show_tips = '好友动态';
  77. } else {
  78. this.show_tips = '';
  79. }
  80. },
  81. onLoad () {
  82. // #ifdef APP-PLUS
  83. // #endif
  84. },
  85. computed: {
  86. domainUrl(){
  87. return _data.domainUrl();
  88. },
  89. },
  90. methods: {
  91. goPath(path){
  92. if(path){
  93. uni.navigateTo({
  94. url: path
  95. });
  96. }
  97. },
  98. goScanCode () {
  99. // uni.navigateTo({
  100. // url: '../chat/videoCall'
  101. // });
  102. let _this = this;
  103. //#ifdef APP-PLUS
  104. _page.scanCode();
  105. //#endif
  106. //#ifdef H5
  107. uni.showToast({
  108. title: '系统繁忙,请稍后再试',
  109. duration: 1500,
  110. mask: false,
  111. icon:'none',
  112. });
  113. //#endif
  114. // uni.scanCode({
  115. // success: function (res) {
  116. // /** 验证必须是一个地址 */
  117. // if (/^(?:http(s)?:\/\/)?[\w.-]+(?:\.[\w\.-]+)+[\w\-\._~:/?#[\]@!\$&'\*\+,;=.]+$/.test(res.result)) {
  118. // /** 本应用页面 */
  119. // console.log(res.result);
  120. // if (new RegExp(_data.data('http_url')).test(res.result)) {
  121. // if (res.result.match(/\/([a-z]+_[a-z]+)\/(.+)$/) && RegExp.$1 && RegExp.$2) {
  122. // console.log(RegExp.$1,'123456789')
  123. // switch (RegExp.$1) {
  124. // case 'chat_add':
  125. // uni.navigateTo({
  126. // url: '/page/details/index?user_id=' + RegExp.$2 + '&is_type=3',
  127. // });
  128. // break;
  129. // case 'group_add':
  130. // let option = (RegExp.$2 + '').split('&');
  131. // _this.$httpSend({
  132. // path: '/im/message/addChat',
  133. // data: { users: option[1], list_id: option[0], type: 1, },
  134. // success_action: true,
  135. // success (res) {
  136. // console.log(res)
  137. // let tips = res.err ? res.msg : '已经申请加入群聊,请耐心等待群管理审核';
  138. // uni.showModal({
  139. // content: tips,
  140. // showCancel: false,
  141. // });
  142. // }
  143. // });
  144. // break;
  145. // default:
  146. // uni.showModal({
  147. // content: '二维码内容:' + res.result,
  148. // showCancel: false,
  149. // });
  150. // break;
  151. // }
  152. // }
  153. // else {
  154. // uni.showModal({
  155. // content: '二维码内容1:' + res.result,
  156. // showCancel: false,
  157. // });
  158. // }
  159. // } /** 打开新地址 */
  160. // else {
  161. // uni.navigateTo({
  162. // url: '../push/web?url=' + encodeURIComponent(res.result),
  163. // });
  164. // }
  165. // }
  166. // else {
  167. // uni.showModal({
  168. // content: '二维码内容:' + res.result,
  169. // showCancel: false,
  170. // });
  171. // }
  172. // },
  173. // fail (e) {
  174. // console.log(e);
  175. // return false;
  176. // return;
  177. // uni.showToast({
  178. // title: '扫码错误:' + JSON.stringify(e),
  179. // duration: 2000,
  180. // });
  181. // },
  182. // });
  183. },
  184. },
  185. }
  186. </script>
  187. <style>
  188. .item-list{
  189. margin-top: 40upx;
  190. }
  191. </style>