infoOne.vue 6.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312
  1. <template>
  2. <view class="center">
  3. <view class="dz"><image src="../../static/dp/dz.png" mode=""></image></view>
  4. <view class="top"><image src="../../static/dp/top.png" mode=""></image></view>
  5. <view class="logo"><image src="../../static/dp/logo.png" mode=""></image></view>
  6. <view class="title">可视化数据大屏</view>
  7. <view class="xl-wrap flex">
  8. <view class="xl-item" v-for="(xlitem, xlindex) in xl.split('')" :key="xlindex">
  9. <view class="xl-item-bg"><image src="../../static/dp/num.png" class="" /></view>
  10. <view class="xl-val">{{ xlitem }}</view>
  11. </view>
  12. </view>
  13. <view class="time-box flex">
  14. <view class="nowdate">{{ newTime }}</view>
  15. <view class="djs">活动倒计时{{ end }}</view>
  16. </view>
  17. <view class="tongzi flex">
  18. <view class="tongzi-title">系统通知</view>
  19. <view class="tongzi-main" v-if="orderlist">
  20. 恭喜{{ orderlist[0].store_for_big_screen ? orderlist[0].store_for_big_screen.name : '总店' }}[{{ orderlist[0].waiter.user.nickname }}][¥{{
  21. orderlist[0]._info[0].cart_info.productInfo.price
  22. }}]成交一笔“{{ orderlist[0]._info[0].cart_info.productInfo.store_name }}”订单(订单编号:{{ orderlist[0].order_id }}) {{ orderlist[0].add_time }} 购买用户:
  23. <text>{{ orderlist[0].user_for_big_screen.nickname }}</text>
  24. </view>
  25. </view>
  26. <view class="glx-box flex">
  27. <view class="glx-item">
  28. <view class="glx-item-num">{{ project }}</view>
  29. <view class="glx-item-font">热卖项目数</view>
  30. </view>
  31. <view class="glx-item">
  32. <view class="glx-item-num">{{ explode_num }}</view>
  33. <view class="glx-item-font">已裂变新客</view>
  34. </view>
  35. <!-- <view class="glx-item">
  36. <view class="glx-item-num">80</view>
  37. <view class="glx-item-font">待裂变新客</view>
  38. </view> -->
  39. <view class="glx-item">
  40. <view class="glx-item-num">{{ user }}</view>
  41. <view class="glx-item-font">会员数</view>
  42. </view>
  43. <view class="glx-item">
  44. <view class="glx-item-num">{{ order }}</view>
  45. <view class="glx-item-font">订单数</view>
  46. </view>
  47. <view class="glx-item">
  48. <view class="glx-item-num">{{ visit }}</view>
  49. <view class="glx-item-font">曝光量</view>
  50. </view>
  51. </view>
  52. <view class="bottom"><image src="../../static/dp/bottom.png" mode=""></image></view>
  53. </view>
  54. </template>
  55. <script>
  56. import { getnewTime, timeComputed } from '@/utils/rocessor.js';
  57. import { loadIndexs, play, order } from '@/api/info.js';
  58. import Voice from '@/utils/QS-baiduyy.js';
  59. export default {
  60. data() {
  61. return {
  62. newTime: '2022.08.22',
  63. end: '',
  64. xl: '000000',
  65. explode_num: '',
  66. order: '',
  67. project: '',
  68. user: '',
  69. visit: '',
  70. list: '',
  71. orderlist: '',
  72. active_end_time: '',
  73. time: ''
  74. };
  75. },
  76. onHide() {
  77. clearTimeout(this.time);
  78. },
  79. // 监听页面卸载
  80. onUnload() {
  81. // 关闭倒计时
  82. clearTimeout(this.time);
  83. },
  84. // 监听页面后退
  85. onBackPress() {
  86. // 关闭倒计时
  87. clearTimeout(this.time);
  88. },
  89. onShow() {
  90. console.log(this.xl.split());
  91. this.open();
  92. },
  93. methods: {
  94. open() {
  95. const obj = this;
  96. uni.showModal({
  97. title: '您好',
  98. content: '欢迎来到城攻闪拓',
  99. success: function(res) {
  100. if (res.confirm) {
  101. obj.loadData();
  102. } else if (res.cancel) {
  103. obj.loadData();
  104. }
  105. }
  106. });
  107. },
  108. loadData() {
  109. const obj = this;
  110. loadIndexs().then(({ data }) => {
  111. this.active_end_time = data.active_end_time;
  112. this.newTime = getnewTime();
  113. this.xl = data.activity_order_pay;
  114. this.explode_num = data.explode_num;
  115. this.order = data.order;
  116. this.project = data.project;
  117. this.user = data.user;
  118. this.visit = data.visit;
  119. this.list = data.store_order[0];
  120. if (this.list) {
  121. Voice({
  122. voiceSet: {
  123. tex: '恭喜拼团成功' + +this.list._info[0].cart_info.productInfo.price + '元'
  124. },
  125. audioSet: {
  126. volume: 1
  127. },
  128. lineUp: true // 加入语音队列
  129. });
  130. play({}, this.list.id).then(e => {});
  131. }
  132. this.djs();
  133. this.time = setTimeout(this.loadData, 1000);
  134. });
  135. },
  136. djs() {
  137. console.log('1111');
  138. let date = new Date(this.active_end_time);
  139. let time1 = date.getTime();
  140. let info = timeComputed(time1);
  141. if (info.day != 0) {
  142. this.end = info.day + '天 ' + info.hours + ':' + info.minutes + ':' + info.seconds;
  143. } else {
  144. this.end = info.hours + ':' + info.minutes + ':' + info.seconds;
  145. }
  146. order({ page: 1, limit: 1, store_id: 0, status: 3 }).then(({ data }) => {
  147. this.orderlist = data;
  148. });
  149. }
  150. }
  151. };
  152. </script>
  153. <style lang="scss">
  154. page,
  155. .center {
  156. position: relative;
  157. height: auto;
  158. min-height: 100%;
  159. background: linear-gradient(180deg, #0b1c9d 0%, #02004d 18%, #02004d 100%);
  160. }
  161. .top {
  162. height: 62rpx;
  163. width: 750rpx;
  164. image {
  165. width: 100%;
  166. height: 100%;
  167. }
  168. }
  169. .dz {
  170. position: absolute;
  171. top: 209rpx;
  172. left: 0;
  173. right: 0;
  174. width: 640rpx;
  175. height: 480rpx;
  176. margin: 0 auto;
  177. image {
  178. width: 100%;
  179. height: 100%;
  180. }
  181. }
  182. .logo {
  183. width: 166rpx;
  184. height: 210rpx;
  185. margin: 44rpx auto 0;
  186. image {
  187. width: 100%;
  188. height: 100%;
  189. }
  190. }
  191. .title {
  192. margin-top: 22rpx;
  193. text-align: center;
  194. font-size: 38rpx;
  195. font-family: PingFang SC;
  196. font-weight: bold;
  197. color: #ffffff;
  198. }
  199. .xl-wrap {
  200. margin-top: 60rpx;
  201. justify-content: space-around;
  202. .xl-item {
  203. position: relative;
  204. width: 106rpx;
  205. height: 140rpx;
  206. text-align: center;
  207. .xl-item-bg {
  208. position: absolute;
  209. top: 0;
  210. left: 0;
  211. right: 0;
  212. width: 106rpx;
  213. height: 140rpx;
  214. image {
  215. width: 100%;
  216. height: 100%;
  217. }
  218. }
  219. .xl-val {
  220. position: relative;
  221. z-index: 2;
  222. font-size: 86rpx;
  223. font-family: SourceHanSansSC;
  224. font-weight: bold;
  225. color: #66ffff;
  226. line-height: 140rpx;
  227. }
  228. }
  229. }
  230. .time-box {
  231. margin: 32rpx 22rpx 0;
  232. font-size: 26rpx;
  233. font-family: PingFang SC;
  234. font-weight: bold;
  235. color: #ffffff;
  236. }
  237. .tongzi {
  238. justify-content: start;
  239. margin: 36rpx auto 0;
  240. width: 700rpx;
  241. border: 5px solid #060c76;
  242. padding: 12rpx;
  243. .tongzi-title {
  244. flex-shrink: 0;
  245. width: 74rpx;
  246. font-size: 25rpx;
  247. font-family: PingFang SC;
  248. font-weight: bold;
  249. color: #66ffff;
  250. padding-right: 20rpx;
  251. border-right: 1px solid #396bb5;
  252. }
  253. .tongzi-main {
  254. margin-left: 10rpx;
  255. font-size: 20rpx;
  256. font-family: PingFang SC;
  257. font-weight: bold;
  258. color: #ffffff;
  259. text {
  260. color: #66ffff;
  261. }
  262. }
  263. }
  264. .glx-box {
  265. position: relative;
  266. z-index: 2;
  267. flex-wrap: wrap;
  268. margin-top: 32rpx;
  269. padding: 0 22rpx 160rpx;
  270. .glx-item {
  271. position: relative;
  272. z-index: 2;
  273. line-height: 1;
  274. margin-top: 20rpx;
  275. width: 342rpx;
  276. height: 203rpx;
  277. background: rgba(102, 255, 255, 0.2);
  278. border: 2px solid #66ffff;
  279. display: flex;
  280. flex-direction: column;
  281. justify-content: center;
  282. align-items: center;
  283. .glx-item-num {
  284. font-size: 71rpx;
  285. font-family: PingFang SC;
  286. font-weight: bold;
  287. color: #fdae3f;
  288. }
  289. .glx-item-font {
  290. margin-top: 28rpx;
  291. font-size: 34rpx;
  292. font-family: PingFang SC;
  293. font-weight: bold;
  294. color: #ffffff;
  295. }
  296. }
  297. }
  298. .bottom {
  299. position: absolute;
  300. bottom: 0;
  301. left: 0;
  302. right: 0;
  303. width: 750rpx;
  304. height: 820rpx;
  305. image {
  306. width: 100%;
  307. height: 100%;
  308. }
  309. }
  310. </style>