index.vue 6.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326
  1. <template>
  2. <view class="index">
  3. <view class="head">
  4. <view class="header" @click="shopDetails">
  5. <image src="/static/index/address.png" mode=""></image>
  6. {{name}}
  7. <image src="/static/index/down.png" mode=""></image>
  8. </view>
  9. </view>
  10. <view class="data_box">
  11. <view class="title">
  12. 今日概况
  13. <image src="/static/index/today.png" mode=""></image>
  14. </view>
  15. <view class="data">
  16. <view class="item">
  17. <span>{{numberOrders}}</span>订单
  18. </view>
  19. <view class="item">
  20. <span>{{income}}</span>收益
  21. </view>
  22. <view class="item">
  23. <span>{{newCustomer}}</span>新客
  24. </view>
  25. </view>
  26. </view>
  27. <view class="service">
  28. <view class="main">
  29. <view class="scan" @click="scan">
  30. <image src="/static/index/scan.png" mode=""></image>扫码核销
  31. </view>
  32. <view class="scan" @click="scanRecord">
  33. <image src="/static/index/record.png" mode=""></image>核销记录
  34. </view>
  35. <view class="scan">
  36. <image src="/static/index/order.png" mode=""></image>售卖订单
  37. </view>
  38. </view>
  39. <view class="other">
  40. <indexNav />
  41. </view>
  42. </view>
  43. <view class="message">
  44. <view class="title">
  45. 实时消息
  46. </view>
  47. <view class="msg">
  48. <view class="item" v-for="(item,index) in msg" :key="index">
  49. <view class="type">
  50. <view class="img">
  51. <image src="/static/index/deal.png" mode="" v-if="item.msgType=='1'"></image>
  52. <image src="/static/index/verify.png" mode="" v-if="item.msgType=='2'"></image>
  53. <image src="/static/index/client.png" mode="" v-if="item.msgType=='3'"></image>
  54. <image src="/static/index/system.png" mode="" v-if="item.msgType=='4'"></image>
  55. <span v-if="item.msgType=='1'">交易信息</span>
  56. <span v-if="item.msgType=='2'">产品核销</span>
  57. <span v-if="item.msgType=='3'">客户评价</span>
  58. <span v-if="item.msgType=='4'">系统消息</span>
  59. </view>
  60. <view class="time">
  61. {{item.msgDate}}
  62. </view>
  63. </view>
  64. <view class="details">
  65. {{item.msgContent}}
  66. </view>
  67. </view>
  68. </view>
  69. </view>
  70. </view>
  71. </template>
  72. <script>
  73. import indexNav from '@/components/index_nav.vue'
  74. export default {
  75. components: {
  76. indexNav
  77. },
  78. data() {
  79. return {
  80. numberOrders: '', //订单
  81. newCustomer: '', //新客
  82. income: '', //收益
  83. name: '滨海广场店',
  84. num: 222,
  85. msg: []
  86. }
  87. },
  88. onLoad: function() {
  89. this.PageCur = 'home'
  90. ++this.commponent1Key
  91. ++this.commponent2Key
  92. },
  93. methods: {
  94. NavChange: function(e) {
  95. this.PageCur = e.currentTarget.dataset.cur
  96. },
  97. //扫码核销
  98. scan() {
  99. uni.navigateTo({
  100. url: '/pages/scan/scan'
  101. })
  102. },
  103. //跳转至门店详情页
  104. shopDetails(){
  105. uni.navigateTo({
  106. url: '/pages/index/shop'
  107. })
  108. },
  109. scanRecord() {
  110. uni.navigateTo({
  111. url: '/pages/scan/record'
  112. })
  113. },
  114. gettodayData() {
  115. this.$http.get("/merchant/app/home/todayData?merchantId=" + '111', {}).then(res => {
  116. if (res.data.code == 200) {
  117. this.income = res.data.result.income
  118. this.newCustomer = res.data.result.newCustomer
  119. this.numberOrders = res.data.result.numberOrders
  120. }
  121. })
  122. },
  123. getMessage(){
  124. this.$http.get("/merchant/app/home/realMessage?merchantId=" + '111', {}).then(res => {
  125. if (res.data.code == 200) {
  126. this.msg = res.data.result.records
  127. // this.income = res.data.result.income
  128. // this.newCustomer = res.data.result.newCustomer
  129. // this.numberOrders = res.data.result.numberOrders
  130. }
  131. })
  132. }
  133. },
  134. mounted() {
  135. this.gettodayData()
  136. this.getMessage()
  137. // let info =
  138. let that = this
  139. uni.getStorage({
  140. key: 'login_user_info',
  141. success: function (res) {
  142. that.name = res.data.merchantName
  143. }
  144. });
  145. }
  146. }
  147. </script>
  148. <style scoped lang="scss">
  149. .index {
  150. width: 100vw;
  151. height: 94vh;
  152. background: #F7F8FC;
  153. .head {
  154. width: 100%;
  155. height: 272rpx;
  156. background: linear-gradient(90deg, #E6FFFF 0%, #CEF7FF 40%, #A3CEFE 73%, #BCD6FF 100%), linear-gradient(to bottom , #F7F8FC 0%, rgba(247,248,252,0) 100%);
  157. padding: 20rpx;
  158. .header {
  159. width: 100%;
  160. height: 112rpx;
  161. display: flex;
  162. align-items: center;
  163. padding: 0px 24rpx;
  164. font-size: 32rpx;
  165. font-weight: 600;
  166. image {
  167. width: 48rpx;
  168. height: 48rpx;
  169. margin-right: 10rpx;
  170. }
  171. image:nth-child(2) {
  172. width: 24rpx;
  173. height: 24rpx;
  174. margin-left: 10rpx;
  175. }
  176. }
  177. }
  178. .data_box {
  179. width: 676rpx;
  180. height: 196rpx;
  181. margin: 20rpx auto;
  182. margin-top: -141rpx;
  183. background: linear-gradient(0, #FFFFFF 0%, #FFF4EA 100%);
  184. box-shadow: 0px 2rpx 8rpx 0px rgba(214, 225, 237, 0.1);
  185. border-radius: 16rpx 16rpx 16rpx 16rpx;
  186. .title {
  187. display: flex;
  188. align-items: center;
  189. width: 100%;
  190. height: 53rpx;
  191. font-size: 28rpx;
  192. font-weight: 600;
  193. border-bottom: 1px solid #eeeeee;
  194. padding: 12rpx 16rpx;
  195. image {
  196. width: 40rpx;
  197. height: 40rpx;
  198. margin-left: 10rpx;
  199. }
  200. }
  201. .data {
  202. display: flex;
  203. justify-content: space-around;
  204. align-items: center;
  205. padding: 20rpx 0px;
  206. .item {
  207. display: flex;
  208. flex-direction: column;
  209. justify-content: space-around;
  210. align-items: center;
  211. font-size: 24rpx;
  212. line-height: 28rpx;
  213. color: #999999;
  214. span {
  215. color: #333;
  216. font-size: 48rpx;
  217. font-weight: 600;
  218. line-height: 56rpx;
  219. }
  220. }
  221. }
  222. }
  223. .service {
  224. width: 676rpx;
  225. // height: 468rpx;
  226. background: linear-gradient(180deg, #FFFFFF 0%, #FFFFFF 100%);
  227. box-shadow: 0px 2rpx 8rpx 0px rgba(214, 225, 237, 0.1);
  228. border-radius: 16rpx;
  229. padding: 24rpx 18rpx;
  230. margin: 0 auto;
  231. .main {
  232. display: flex;
  233. justify-content: space-around;
  234. margin-bottom: 40rpx;
  235. .scan {
  236. display: flex;
  237. flex-direction: column;
  238. font-size: 26rpx;
  239. font-weight: 600;
  240. image {
  241. width: 106rpx;
  242. height: 106rpx;
  243. margin-bottom: 4rpx;
  244. }
  245. }
  246. }
  247. }
  248. .message {
  249. width: 676rpx;
  250. padding: 20rpx 16rpx;
  251. margin: 20rpx auto 0px;
  252. background: linear-gradient(0, #FFFFFF 0%, #E2EFFF 100%);
  253. border-radius: 16rpx;
  254. .title {
  255. width: 100%;
  256. height: 53rpx;
  257. display: flex;
  258. align-items: center;
  259. margin-bottom: 20rpx;
  260. }
  261. .msg {
  262. width: 100%;
  263. .item {
  264. width: 100%;
  265. // height: 126rpx;
  266. // margin: 20rpx auto;
  267. border-bottom: 1px solid #dddddd;
  268. margin-bottom: 20rpx;
  269. .type {
  270. width: 100%;
  271. height: 38rpx;
  272. display: flex;
  273. align-items: center;
  274. justify-content: space-between;
  275. margin-bottom: 8rpx;
  276. .img {
  277. font-size: 26rpx;
  278. font-weight: 600;
  279. display: flex;
  280. align-items: center;
  281. image {
  282. width: 30rpx;
  283. height: 30rpx;
  284. margin-right: 8rpx;
  285. }
  286. }
  287. .time {
  288. font-size: 22rpx;
  289. color: #999999;
  290. }
  291. }
  292. .details{
  293. font-size: 22rpx;
  294. color: #999999;
  295. margin-bottom: 16rpx;
  296. }
  297. }
  298. }
  299. }
  300. }
  301. </style>