index.vue 7.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345
  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. merchantId:''
  88. }
  89. },
  90. onLoad: function() {
  91. this.PageCur = 'home'
  92. ++this.commponent1Key
  93. ++this.commponent2Key
  94. },
  95. methods: {
  96. NavChange: function(e) {
  97. this.PageCur = e.currentTarget.dataset.cur
  98. },
  99. //扫码核销
  100. scan() {
  101. uni.navigateTo({
  102. url: '/pages/scan/manual'
  103. })
  104. },
  105. //跳转至门店详情页
  106. shopDetails(){
  107. uni.navigateTo({
  108. url: '/pages/index/shop'
  109. })
  110. },
  111. scanRecord() {
  112. uni.navigateTo({
  113. url: '/pages/scan/record'
  114. })
  115. },
  116. scanRecordaa() {
  117. // uni.navigateTo({
  118. // url: '/pages/login/login'
  119. // })
  120. },
  121. gettodayData() {
  122. this.$http.get("/merchant/app/home/todayData?merchantId=" + this.merchantId, {}).then(res => {
  123. if (res.data.code == 200) {
  124. this.income = res.data.result.income
  125. this.newCustomer = res.data.result.newCustomer
  126. this.numberOrders = res.data.result.numberOrders
  127. }
  128. })
  129. },
  130. getMessage(){
  131. this.$http.get("/merchant/app/home/realMessage?merchantId=" + this.merchantId, {}).then(res => {
  132. if (res.data.code == 200) {
  133. this.msg = res.data.result.records
  134. // this.income = res.data.result.income
  135. // this.newCustomer = res.data.result.newCustomer
  136. // this.numberOrders = res.data.result.numberOrders
  137. }
  138. })
  139. }
  140. },
  141. mounted() {
  142. // let info =
  143. let that = this
  144. },
  145. onShow() {
  146. let that = this
  147. uni.getStorage({
  148. key: 'login_user_info',
  149. success: function (res) {
  150. that.name = res.data.merchantName
  151. that.merchantId = res.data.merchantId
  152. that.gettodayData()
  153. that.getMessage()
  154. }
  155. });
  156. }
  157. }
  158. </script>
  159. <style scoped lang="scss">
  160. .index {
  161. width: 100vw;
  162. height: 94vh;
  163. background: #F7F8FC;
  164. .head {
  165. width: 100%;
  166. height: 272rpx;
  167. background: linear-gradient(90deg, #E6FFFF 0%, #CEF7FF 40%, #A3CEFE 73%, #BCD6FF 100%), linear-gradient(360deg, #F7F8FC 0%, rgba(247,248,252,0) 100%);
  168. padding: 20rpx;
  169. .header {
  170. width: 100%;
  171. height: 112rpx;
  172. display: flex;
  173. align-items: center;
  174. padding: 0px 24rpx;
  175. font-size: 32rpx;
  176. font-weight: 600;
  177. image {
  178. width: 48rpx;
  179. height: 48rpx;
  180. margin-right: 10rpx;
  181. }
  182. image:nth-child(2) {
  183. width: 24rpx;
  184. height: 24rpx;
  185. margin-left: 10rpx;
  186. }
  187. }
  188. }
  189. /*#ifdef APP-PLUS*/
  190. .top {
  191. width: 100%;
  192. height: var(--status-bar-height);
  193. background: linear-gradient(90deg, #E6FFFF 0%, #CEF7FF 40%, #A3CEFE 73%, #BCD6FF 100%), linear-gradient(to bottom , #F7F8FC 0%, rgba(247,248,252,0) 100%);
  194. }
  195. /*#endif*/
  196. .data_box {
  197. width: 676rpx;
  198. height: 196rpx;
  199. margin: 20rpx auto;
  200. margin-top: -141rpx;
  201. background: linear-gradient(0, #FFFFFF 0%, #FFF4EA 100%);
  202. box-shadow: 0px 2rpx 8rpx 0px rgba(214, 225, 237, 0.1);
  203. border-radius: 16rpx 16rpx 16rpx 16rpx;
  204. .title {
  205. display: flex;
  206. align-items: center;
  207. width: 100%;
  208. height: 53rpx;
  209. font-size: 28rpx;
  210. font-weight: 600;
  211. border-bottom: 1px solid #eeeeee;
  212. padding: 12rpx 16rpx;
  213. image {
  214. width: 40rpx;
  215. height: 40rpx;
  216. margin-left: 10rpx;
  217. }
  218. }
  219. .data {
  220. display: flex;
  221. justify-content: space-around;
  222. align-items: center;
  223. padding: 20rpx 0px;
  224. .item {
  225. display: flex;
  226. flex-direction: column;
  227. justify-content: space-around;
  228. align-items: center;
  229. font-size: 24rpx;
  230. line-height: 28rpx;
  231. color: #999999;
  232. span {
  233. color: #333;
  234. font-size: 48rpx;
  235. font-weight: 600;
  236. line-height: 56rpx;
  237. }
  238. }
  239. }
  240. }
  241. .service {
  242. width: 676rpx;
  243. // height: 468rpx;
  244. background: linear-gradient(180deg, #FFFFFF 0%, #FFFFFF 100%);
  245. box-shadow: 0px 2rpx 8rpx 0px rgba(214, 225, 237, 0.1);
  246. border-radius: 16rpx;
  247. padding: 24rpx 18rpx;
  248. margin: 0 auto;
  249. .main {
  250. display: flex;
  251. justify-content: space-around;
  252. margin-bottom: 40rpx;
  253. .scan {
  254. display: flex;
  255. flex-direction: column;
  256. font-size: 26rpx;
  257. font-weight: 600;
  258. align-items: center;
  259. image {
  260. width: 106rpx;
  261. height: 106rpx;
  262. margin-bottom: 4rpx;
  263. }
  264. }
  265. }
  266. }
  267. .message {
  268. width: 676rpx;
  269. padding: 20rpx 16rpx;
  270. margin: 20rpx auto 0px;
  271. background: linear-gradient(0, #FFFFFF 0%, #E2EFFF 100%);
  272. border-radius: 16rpx;
  273. .title {
  274. width: 100%;
  275. height: 53rpx;
  276. display: flex;
  277. align-items: center;
  278. margin-bottom: 20rpx;
  279. }
  280. .msg {
  281. width: 100%;
  282. .item {
  283. width: 100%;
  284. // height: 126rpx;
  285. // margin: 20rpx auto;
  286. border-bottom: 1px solid #dddddd;
  287. margin-bottom: 20rpx;
  288. .type {
  289. width: 100%;
  290. height: 38rpx;
  291. display: flex;
  292. align-items: center;
  293. justify-content: space-between;
  294. margin-bottom: 8rpx;
  295. .img {
  296. font-size: 26rpx;
  297. font-weight: 600;
  298. display: flex;
  299. align-items: center;
  300. image {
  301. width: 30rpx;
  302. height: 30rpx;
  303. margin-right: 8rpx;
  304. }
  305. }
  306. .time {
  307. font-size: 22rpx;
  308. color: #999999;
  309. }
  310. }
  311. .details{
  312. font-size: 22rpx;
  313. color: #999999;
  314. margin-bottom: 16rpx;
  315. }
  316. }
  317. }
  318. }
  319. }
  320. </style>