startPage.vue 4.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206
  1. <template>
  2. <view class="box" @click="starBtn">
  3. <view class="header">
  4. <image style="width: 100%; height: 100%" src="/static/img/star_lg.png"></image>
  5. </view>
  6. <view class="tit_box">
  7. <image style="width: 100%; height: 100%" src="/static/img/star_tit.png"></image>
  8. <view class="logo">
  9. <image style="width: 100%; height: 100%" src="/static/img/img_seal@2x.png"></image>
  10. </view>
  11. </view>
  12. <view class="eng_tit">Huli Cultural Heritage Protection Center</view>
  13. <view class="introduce_tit">
  14. <view class="btm">因手艺而经典,因守艺而传承</view>
  15. <view class="btm">非遗匠艺,是时代文明记忆,也是城市情感记忆</view>
  16. <view class="btm">触碰历史的温度,感受匠心的力量</view>
  17. <view class="">一场非遗匠艺手作之旅即将优雅启程</view>
  18. </view>
  19. <view @click="starBtn" style="cursor: pointer; margin: auto; width: 2200rpx; height: 660rpx">
  20. <view class="star_btn">
  21. <view class="star_btn2">开始探索</view>
  22. </view>
  23. </view>
  24. </view>
  25. </template>
  26. <script>
  27. let that;
  28. export default {
  29. data() {
  30. return {
  31. timeout: 30000, // 30s
  32. timeoutObj: null
  33. };
  34. },
  35. onLoad() {
  36. that = this;
  37. },
  38. methods: {
  39. starBtn() {
  40. uni.navigateTo({
  41. url: '/pages/index/index'
  42. });
  43. // .判断是否已连接
  44. // this.checkOpenSocket();
  45. }
  46. // 判断是否已连接
  47. // checkOpenSocket() {
  48. // uni.sendSocketMessage({
  49. // data: 'ping',
  50. // success: (res) => {
  51. // this.send();
  52. // return;
  53. // },
  54. // fail: (err) => {
  55. // // 未连接打开websocket连接
  56. // this.openConnection();
  57. // }
  58. // });
  59. // },
  60. // openConnection() {
  61. // // 打开连接
  62. // // uni.closeSocket(); // 确保已经关闭后再重新打开
  63. // uni.connectSocket({
  64. // url: 'ws://192.168.10.80:8002',
  65. // success(res) {
  66. // console.log('连接成功 connectSocket=', res);
  67. // },
  68. // fail(err) {
  69. // console.log('连接失败 connectSocket=', err);
  70. // }
  71. // });
  72. // uni.onSocketOpen((res) => {
  73. // console.log('连接成功');
  74. // this.send();
  75. // });
  76. // this.onSocketMessage(); // 打开成功监听服务器返回的消息
  77. // },
  78. // send() {
  79. // uni.sendSocketMessage({
  80. // // 发送的指令
  81. // data: '{"command":"control","code":"quanxiplay"}',
  82. // success: (res) => {
  83. // console.log(res, 88888);
  84. // console.log('发送成功....');
  85. // },
  86. // fail: (err) => {
  87. // console.log(res);
  88. // console.log('连接失败重新连接....');
  89. // this.openConnection();
  90. // }
  91. // });
  92. // },
  93. // onSocketMessage() {
  94. // // 消息
  95. // this.timeout = 30000;
  96. // this.timeoutObj = null;
  97. // uni.onSocketMessage((res) => {
  98. // console.log(res);
  99. // this.getSocketMsg(res.data); // 监听到有新服务器消息
  100. // });
  101. // },
  102. // // 监听到有新服务器消息
  103. // getSocketMsg(reData) {
  104. // // 监听到服务器消息
  105. // console.log('收到服务器消息', reData);
  106. // this.reset(); // 检测心跳reset,防止长时间连接导致连接关闭
  107. // },
  108. // // 检测心跳reset
  109. // reset() {
  110. // clearInterval(this.timeoutObj);
  111. // this.start(); // 启动心跳
  112. // },
  113. // // 启动心跳 start
  114. // start() {
  115. // this.timeoutObj = setInterval(function () {
  116. // uni.sendSocketMessage({
  117. // data: 'ping',
  118. // success: (res) => {
  119. // console.log('连接中....');
  120. // },
  121. // fail: (err) => {
  122. // console.log('连接失败重新连接....');
  123. // that.openConnection();
  124. // }
  125. // });
  126. // }, this.timeout);
  127. // }
  128. }
  129. };
  130. </script>
  131. <style>
  132. .box {
  133. width: 100%;
  134. height: 1906rpx;
  135. background: url('/static/img/stra_bj.png') no-repeat center;
  136. background-size: 100% 100%;
  137. padding-top: 200rpx;
  138. box-sizing: border-box;
  139. cursor: pointer;
  140. }
  141. .header {
  142. width: 522rpx;
  143. height: 100rpx;
  144. margin: auto;
  145. }
  146. .tit_box {
  147. display: flex;
  148. margin: auto;
  149. margin-top: 60rpx;
  150. width: 2200rpx;
  151. height: 160rpx;
  152. }
  153. .logo {
  154. width: 48rpx;
  155. height: 180rpx;
  156. margin-left: 20rpx;
  157. }
  158. .eng_tit {
  159. width: 1200rpx;
  160. height: 120rpx;
  161. margin: auto;
  162. font-size: 48rpx;
  163. color: #989694;
  164. text-align: center;
  165. margin-top: 60rpx;
  166. }
  167. .introduce_tit {
  168. width: 1600rpx;
  169. height: 400rpx;
  170. margin: auto;
  171. letter-spacing: 0.1em;
  172. text-align: center;
  173. color: #3f3d3a;
  174. font-size: 48rpx;
  175. }
  176. .btm {
  177. margin-bottom: 40rpx;
  178. }
  179. .star_btn {
  180. width: 340rpx;
  181. padding: 16rpx 0 16rpx 0;
  182. margin: auto;
  183. cursor: pointer;
  184. background-color: #fee9d4;
  185. box-sizing: border-box;
  186. }
  187. .star_btn2 {
  188. width: 300rpx;
  189. height: 100rpx;
  190. line-height: 100rpx;
  191. text-align: center;
  192. font-size: 50rpx;
  193. margin: auto;
  194. letter-spacing: 0.2em;
  195. border: 1px solid #563530;
  196. background: linear-gradient(270deg, #bc5f29 0%, #5b3c29 100%);
  197. -webkit-background-clip: text;
  198. -webkit-text-fill-color: transparent;
  199. }
  200. </style>