index.vue 8.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389
  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. <!-- 完善信息弹窗,storeStatus == 3 (店铺已经审核通过 ) -->
  45. <checkPopup :status="storeStatus" :describe="describe" :referenceId="referenceId" @cutPopup="isPopup = false " v-if="isPopup" />
  46. <!-- <view class="message">
  47. <view class="title">
  48. 实时消息
  49. </view>
  50. <view class="msg">
  51. <view class="item" v-for="(item,index) in msg" :key="index">
  52. <view class="type">
  53. <view class="img">
  54. <image src="/static/index/deal.png" mode="" v-if="item.msgType=='1'"></image>
  55. <image src="/static/index/verify.png" mode="" v-if="item.msgType=='2'"></image>
  56. <image src="/static/index/client.png" mode="" v-if="item.msgType=='3'"></image>
  57. <image src="/static/index/system.png" mode="" v-if="item.msgType=='4'"></image>
  58. <span v-if="item.msgType=='1'">交易信息</span>
  59. <span v-if="item.msgType=='2'">产品核销</span>
  60. <span v-if="item.msgType=='3'">客户评价</span>
  61. <span v-if="item.msgType=='4'">系统消息</span>
  62. </view>
  63. <view class="time">
  64. {{item.msgDate}}
  65. </view>
  66. </view>
  67. <view class="details">
  68. {{item.msgContent}}
  69. </view>
  70. </view>
  71. </view>
  72. </view> -->
  73. </view>
  74. </template>
  75. <script>
  76. import indexNav from '@/components/index_nav.vue';
  77. import checkPopup from '@/components/check-popup.vue'
  78. export default {
  79. components: {
  80. indexNav,
  81. checkPopup
  82. },
  83. data() {
  84. return {
  85. numberOrders: '', //订单
  86. newCustomer: '', //新客
  87. income: '', //收益
  88. name: '',
  89. num: 222,
  90. msg: [],
  91. merchantId: '',
  92. storeStatus: 0, //商户店铺设置状态
  93. userId: '', //用户id
  94. describe: '', //描述
  95. isPopup: false ,//弹窗是否出现
  96. referenceId:''//邀请码
  97. }
  98. },
  99. onLoad: function() {
  100. this.PageCur = 'home'
  101. ++this.commponent1Key
  102. ++this.commponent2Key
  103. },
  104. methods: {
  105. NavChange: function(e) {
  106. this.PageCur = e.currentTarget.dataset.cur
  107. },
  108. //新客
  109. goUser() {
  110. uni.navigateTo({
  111. url: '/pages/index/userControl'
  112. })
  113. },
  114. //扫码核销
  115. scan() {
  116. uni.navigateTo({
  117. url: '/pages/scan/manual'
  118. })
  119. },
  120. //跳转至门店详情页
  121. shopDetails() {
  122. uni.navigateTo({
  123. url: '/pages/index/shop'
  124. })
  125. },
  126. scanRecord() {
  127. uni.navigateTo({
  128. url: '/pages/scan/record'
  129. })
  130. },
  131. scanRecordaa() {
  132. // uni.navigateTo({
  133. // url: '/pages/login/login'
  134. // })
  135. },
  136. gettodayData() {
  137. this.$http.get("/merchant/app/home/todayData?merchantId=" + this.merchantId, {}).then(res => {
  138. if (res.data.code == 200) {
  139. this.income = res.data.result.income
  140. // this.newCustomer = res.data.result.newCustomer
  141. this.numberOrders = res.data.result.numberOrders
  142. }
  143. })
  144. },
  145. getMessage() {
  146. this.$http.get("/merchant/app/home/realMessage?merchantId=" + this.merchantId, {}).then(res => {
  147. if (res.data.code == 200) {
  148. this.msg = res.data.result.records
  149. // this.income = res.data.result.income
  150. // this.newCustomer = res.data.result.newCustomer
  151. // this.numberOrders = res.data.result.numberOrders
  152. }
  153. })
  154. },
  155. getNum() {
  156. let data = {}
  157. this.$http.post('/newCustomer/count', data).then(res => {
  158. this.newCustomer = res.data.result.newCustomerCount
  159. })
  160. },
  161. //获取商户是否完善店铺信息
  162. getStroeStatus() {
  163. this.$http.get("/merchant/app/checkMerchantInfo?userId=" + this.userId).then(res => {
  164. if (res.data.code == 200) {
  165. //message == 3(审核已通过)
  166. if (res.data.result != 3) {
  167. this.storeStatus = res.data.result
  168. this.describe = res.data.message
  169. // this.referenceId = res.data.result.referenceId
  170. res.data.result == 3 ? this.isPopup = false : this.isPopup = true
  171. uni.hideTabBar()
  172. }
  173. }
  174. })
  175. },
  176. },
  177. mounted() {
  178. // let info =
  179. let that = this
  180. },
  181. onShow() {
  182. let that = this
  183. uni.getStorage({
  184. key: 'login_user_info',
  185. success: function(res) {
  186. console.log(res)
  187. that.name = res.data.merchantName
  188. that.merchantId = res.data.merchantId
  189. that.userId = res.data.id
  190. that.gettodayData()
  191. that.getMessage()
  192. that.getNum()
  193. that.getStroeStatus()
  194. }
  195. });
  196. }
  197. }
  198. </script>
  199. <style scoped lang="scss">
  200. .index {
  201. width: 100vw;
  202. height: 94vh;
  203. background: #F7F8FC;
  204. .head {
  205. width: 100%;
  206. height: 272rpx;
  207. background: linear-gradient(90deg, #E6FFFF 0%, #CEF7FF 40%, #A3CEFE 73%, #BCD6FF 100%), linear-gradient(360deg, #F7F8FC 0%, rgba(247, 248, 252, 0) 100%);
  208. padding: 20rpx;
  209. .header {
  210. width: 100%;
  211. height: 112rpx;
  212. display: flex;
  213. align-items: center;
  214. padding: 0px 24rpx;
  215. font-size: 32rpx;
  216. font-weight: 600;
  217. image {
  218. width: 48rpx;
  219. height: 48rpx;
  220. margin-right: 10rpx;
  221. }
  222. image:nth-child(2) {
  223. width: 24rpx;
  224. height: 24rpx;
  225. margin-left: 10rpx;
  226. }
  227. }
  228. }
  229. /*#ifdef APP-PLUS*/
  230. .top {
  231. width: 100%;
  232. height: var(--status-bar-height);
  233. background: linear-gradient(90deg, #E6FFFF 0%, #CEF7FF 40%, #A3CEFE 73%, #BCD6FF 100%), linear-gradient(to bottom, #F7F8FC 0%, rgba(247, 248, 252, 0) 100%);
  234. }
  235. /*#endif*/
  236. .data_box {
  237. width: 676rpx;
  238. height: 196rpx;
  239. margin: 20rpx auto;
  240. margin-top: -141rpx;
  241. background: linear-gradient(0, #FFFFFF 0%, #FFF4EA 100%);
  242. box-shadow: 0px 2rpx 8rpx 0px rgba(214, 225, 237, 0.1);
  243. border-radius: 16rpx 16rpx 16rpx 16rpx;
  244. .title {
  245. display: flex;
  246. align-items: center;
  247. width: 100%;
  248. height: 53rpx;
  249. font-size: 28rpx;
  250. font-weight: 600;
  251. border-bottom: 1px solid #eeeeee;
  252. padding: 12rpx 16rpx;
  253. image {
  254. width: 40rpx;
  255. height: 40rpx;
  256. margin-left: 10rpx;
  257. }
  258. }
  259. .data {
  260. display: flex;
  261. justify-content: space-around;
  262. align-items: center;
  263. padding: 20rpx 0px;
  264. .item {
  265. display: flex;
  266. flex-direction: column;
  267. justify-content: space-around;
  268. align-items: center;
  269. font-size: 24rpx;
  270. line-height: 28rpx;
  271. color: #999999;
  272. span {
  273. color: #333;
  274. font-size: 48rpx;
  275. font-weight: 600;
  276. line-height: 56rpx;
  277. }
  278. }
  279. }
  280. }
  281. .service {
  282. width: 676rpx;
  283. // height: 468rpx;
  284. background: linear-gradient(180deg, #FFFFFF 0%, #FFFFFF 100%);
  285. box-shadow: 0px 2rpx 8rpx 0px rgba(214, 225, 237, 0.1);
  286. border-radius: 16rpx;
  287. padding: 24rpx 18rpx;
  288. margin: 0 auto;
  289. .main {
  290. display: flex;
  291. justify-content: space-around;
  292. margin-bottom: 40rpx;
  293. .scan {
  294. display: flex;
  295. flex-direction: column;
  296. font-size: 26rpx;
  297. font-weight: 600;
  298. align-items: center;
  299. image {
  300. width: 106rpx;
  301. height: 106rpx;
  302. margin-bottom: 4rpx;
  303. }
  304. }
  305. }
  306. }
  307. .message {
  308. width: 676rpx;
  309. padding: 20rpx 16rpx;
  310. margin: 20rpx auto 0px;
  311. background: linear-gradient(0, #FFFFFF 0%, #E2EFFF 100%);
  312. border-radius: 16rpx;
  313. .title {
  314. width: 100%;
  315. height: 53rpx;
  316. display: flex;
  317. align-items: center;
  318. margin-bottom: 20rpx;
  319. }
  320. .msg {
  321. width: 100%;
  322. .item {
  323. width: 100%;
  324. // height: 126rpx;
  325. // margin: 20rpx auto;
  326. border-bottom: 1px solid #dddddd;
  327. margin-bottom: 20rpx;
  328. .type {
  329. width: 100%;
  330. height: 38rpx;
  331. display: flex;
  332. align-items: center;
  333. justify-content: space-between;
  334. margin-bottom: 8rpx;
  335. .img {
  336. font-size: 26rpx;
  337. font-weight: 600;
  338. display: flex;
  339. align-items: center;
  340. image {
  341. width: 30rpx;
  342. height: 30rpx;
  343. margin-right: 8rpx;
  344. }
  345. }
  346. .time {
  347. font-size: 22rpx;
  348. color: #999999;
  349. }
  350. }
  351. .details {
  352. font-size: 22rpx;
  353. color: #999999;
  354. margin-bottom: 16rpx;
  355. }
  356. }
  357. }
  358. }
  359. }
  360. </style>