index.vue 7.3 KB

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