index.vue 7.8 KB

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