game.vue 7.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338
  1. <template>
  2. <view class="page">
  3. <!-- #ifdef APP-PLUS -->
  4. <view class="topTitle">
  5. <view class="topFont">
  6. 探索
  7. </view>
  8. <view class="topBG">
  9. <view class="bgCenter" @click="goPath('../push/circle')">
  10. <view class="bgLf">
  11. <image src="/static/img/circle.gif" mode=""></image>
  12. <text>朋友圈</text>
  13. </view>
  14. </view>
  15. </view>
  16. </view>
  17. <!-- #endif -->
  18. <!-- #ifdef H5 || MP-WEIXIN-->
  19. <view class="topTitle">
  20. <view class="topFont">
  21. 探索
  22. </view>
  23. <view class="topBG">
  24. <view class="bgCenter" @click="goPath('../push/circle')">
  25. <view class="bgLf">
  26. <image src="/static/img/circle.gif" mode=""></image>
  27. <text>朋友圈</text>
  28. </view>
  29. </view>
  30. </view>
  31. </view>
  32. <!-- #endif -->
  33. <view class="listOut">
  34. <uni-list class="item-list">
  35. <!-- <uni-list-item title="扫一扫" class="item-list-item" :border="false" :show-arrow="true" :show-badge="true"
  36. badge-type="error" :showArrow="true" badge-text=" "
  37. thumb="/static/theme/default/push/icon_chat_top_encrypt.png" @click="goScanCode" />
  38. <!-- <uni-list-item title="默往声明" :show-arrow="false" :border="false" :show-badge="true" badge-type="error"
  39. :showArrow="true" thumb="/static/theme/default/push/icon_chat_top_screenshot.png"
  40. @click="goScanCode">
  41. </uni-list-item> -->
  42. <!-- #ifdef APP-PLUS -->
  43. <uni-list-item title="扫一扫" :show-arrow="false" :show-badge="false" badge-type="error" :showArrow="true"
  44. thumb="../../static/img/sao.png" @click="goScanCode" />
  45. <!-- #endif -->
  46. <uni-list-item thumbSize="lg" title="短视频" :show-arrow="false" :show-badge="false" badge-type="error"
  47. :showArrow="true" thumb="../../static/img/video.png" @click="goPath('/pages/video/find')">
  48. </uni-list-item>
  49. <uni-list-item :show_border="false" title="一键群发" :show-arrow="false" :show-badge="false"
  50. badge-type="error" :showArrow="true" thumb="../../static/img/trans.png" :border="false"
  51. @click="goPath('/pages/push/create_group')" />
  52. <!--自定义网址-->
  53. <uni-list-item :title="item.appName" v-if="list.length" v-for="(item,index) in list"
  54. z:show-arrow="false" :show-badge="false" badge-type="error" :showArrow="true"
  55. :thumb="domainUrl +item.logo_url"
  56. @click="goPath('web?url='+item.url+'&title='+item.appName+'&agent_user_id='+item.agent_user_id )" />
  57. <!--自定义网址-->
  58. </uni-list>
  59. </view>
  60. <!--<uni-list-item title="群发" style="background-color: white;border-bottom: none;"
  61. thumb="../../static/img/qunfa.png" @click="goPath('/pages/push/sendall')" />-->
  62. </uni-list>
  63. </uni-list>
  64. </view>
  65. </template>
  66. <script>
  67. import _hook from '../../common/_hook';
  68. import _data from '../../common/_data';
  69. import _get from '../../common/_get';
  70. import uniList from '../../components/uni-ui/uni-list/uni-list.vue';
  71. import uniListItem from '../../components/uni-ui/uni-list-item/uni-list-item.vue';
  72. import uniIcon from "../../components/uni-ui/uni-icon/uni-icon.vue"
  73. export default {
  74. components: {
  75. uniList,
  76. uniListItem,
  77. uniIcon
  78. },
  79. data() {
  80. return {
  81. list: [],
  82. show_tips: ''
  83. }
  84. },
  85. onShow() {
  86. let _this = this;
  87. _hook.routeTabBarHook();
  88. _get.getOnlineList({}, function(res) {
  89. _this.list = res
  90. });
  91. let num = _data.data('no_reader_circle_chat_num');
  92. /** 监听朋友圈动态提示 */
  93. uni.$on('data_circle_tips', function(data) {
  94. _this.show_tips = data;
  95. });
  96. if (num) {
  97. this.show_tips = num;
  98. } else if (_data.data('no_reader_circle')) {
  99. this.show_tips = '好友动态';
  100. } else {
  101. this.show_tips = '';
  102. }
  103. },
  104. onLoad() {
  105. // #ifdef APP-PLUS
  106. // #endif
  107. },
  108. computed: {
  109. domainUrl() {
  110. return _data.domainUrl();
  111. },
  112. },
  113. methods: {
  114. goPath(path) {
  115. if (path) {
  116. uni.navigateTo({
  117. url: path
  118. });
  119. }
  120. },
  121. goScanCode() {
  122. // uni.navigateTo({
  123. // url: '../chat/videoCall'
  124. // });
  125. let _this = this;
  126. uni.scanCode({
  127. success: function(res) {
  128. /** 验证必须是一个地址 */
  129. if (/^(?:http(s)?:\/\/)?[\w.-]+(?:\.[\w\.-]+)+[\w\-\._~:/?#[\]@!\$&'\*\+,;=.]+$/.test(
  130. res.result)) {
  131. /** 本应用页面 */
  132. console.log(res.result);
  133. if (new RegExp(_data.data('http_url')).test(res.result)) {
  134. if (res.result.match(/\/([a-z]+_[a-z]+)\/(.+)$/) && RegExp.$1 && RegExp.$2) {
  135. switch (RegExp.$1) {
  136. case 'chat_add':
  137. uni.navigateTo({
  138. url: '/page/details/index?user_id=' + RegExp.$2 +
  139. '&is_type=3',
  140. });
  141. break;
  142. case 'group_add':
  143. let option = (RegExp.$2 + '').split('&');
  144. _this.$httpSend({
  145. path: '/im/message/addChat',
  146. data: {
  147. users: option[1],
  148. list_id: option[0],
  149. type: 1,
  150. },
  151. success_action: true,
  152. success(res) {
  153. let tips = res.err ? res.msg :
  154. '已经申请加入群聊,请耐心等待群管理审核';
  155. uni.showModal({
  156. content: tips,
  157. showCancel: false,
  158. });
  159. }
  160. });
  161. break;
  162. default:
  163. console.log('哪里');
  164. uni.showModal({
  165. content: '二维码内容:' + res.result,
  166. showCancel: false,
  167. });
  168. break;
  169. }
  170. } else {
  171. console.log('这里');
  172. uni.showModal({
  173. content: '二维码内容:' + res.result,
  174. showCancel: false,
  175. });
  176. }
  177. } /** 打开新地址 */
  178. else {
  179. uni.navigateTo({
  180. url: '../push/web?url=' + encodeURIComponent(res.result),
  181. });
  182. }
  183. } else {
  184. let da = JSON.parse(res.result)
  185. if(da.action == 'chat_add') {
  186. console.log('在这里');
  187. uni.navigateTo({
  188. url: '/pages/details/index?user_id=' + da.user_id +
  189. '&is_type=3',
  190. fail(err) {
  191. console.log(err);
  192. }
  193. });
  194. }else {
  195. uni.showModal({
  196. content: '二维码内容:' + res.result,
  197. showCancel: false,
  198. });
  199. }
  200. }
  201. },
  202. fail(e) {
  203. console.log(e);
  204. return false;
  205. return;
  206. uni.showToast({
  207. title: '扫码错误:' + JSON.stringify(e),
  208. duration: 2000,
  209. });
  210. },
  211. });
  212. },
  213. },
  214. }
  215. </script>
  216. <style>
  217. .no_border .uni-list-item__container:after {
  218. display: none !important;
  219. }
  220. .listOut .uni-badge-error {
  221. height: 14upx !important;
  222. width: 14upx !important;
  223. padding: 0 !important;
  224. border-radius: 50% !important;
  225. }
  226. body {
  227. height: 100%;
  228. background-color: #F7F7F7;
  229. }
  230. </style>
  231. <style scoped>
  232. page {
  233. background: #f9f9f9;
  234. }
  235. .listOut {
  236. width: 100%;
  237. box-sizing: border-box;
  238. padding: 0 30rpx;
  239. margin-top: 30rpx;
  240. }
  241. .item-list {
  242. /* margin-top: 40upx; */
  243. background-color: #fff;
  244. border-radius: 20rpx;
  245. }
  246. .item-list-item {
  247. border: none;
  248. }
  249. .uni-list-item__container:after {
  250. background-color: #fff !important;
  251. }
  252. .topTitle {
  253. box-sizing: border-box;
  254. padding: 20rpx 30rpx;
  255. box-sizing: border-box;
  256. /* #ifdef APP-PLUS */
  257. padding-top: var(--status-bar-height);
  258. /* #endif */
  259. width: 100vw;
  260. }
  261. .topFont {
  262. font-size: 40rpx;
  263. color: #080E18;
  264. font-weight: bold;
  265. margin-left: 10rpx;
  266. margin-bottom: 10rpx;
  267. }
  268. .topBG {
  269. width: 100%;
  270. height: 223rpx;
  271. border-radius: 40rpx;
  272. background-color: #2C3554;
  273. display: flex;
  274. align-items: center;
  275. align-self: center;
  276. align-content: center;
  277. box-sizing: border-box;
  278. padding: 0 30rpx;
  279. }
  280. .bgCenter {
  281. flex: 1;
  282. }
  283. .bgLf {
  284. display: flex;
  285. justify-content: flex-start;
  286. align-items: center;
  287. position: relative;
  288. }
  289. .bgLf:after {
  290. font-family: uniicons;
  291. content: '\e583';
  292. position: absolute;
  293. right: 0;
  294. top: -10rpx;
  295. font-size: 24px;
  296. color: #fff;
  297. }
  298. .bgLf>image {
  299. width: 60rpx;
  300. height: 60rpx;
  301. }
  302. .bgLf>text {
  303. color: #fff;
  304. font-size: 38rpx;
  305. margin-left: 20rpx;
  306. font-weight: bold;
  307. }
  308. </style>