shopPage.vue 12 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507
  1. <template>
  2. <view class="container">
  3. <view class="vheigh"></view>
  4. <scroll-view class="content-box" scroll-y="true">
  5. <view class="user-section">
  6. <view class="user-info-box ">
  7. <view class="detail flex" @click="navTo('/pages/set/userinfo')">
  8. <view class="portrait-box">
  9. <image class="portrait" :src="shopAction.image || '/static/error/shopErroe.png'"></image>
  10. </view>
  11. <view class="info-box">
  12. <view class="username">{{ shopAction.name?shopAction.name:'载入中'}}</view>
  13. <view class="authentication success">已认证</view>
  14. </view>
  15. </view>
  16. </view>
  17. </view>
  18. <view class="cover-container">
  19. <view class="tj-sction" v-if="type==1">
  20. <view class="tj-item" @click="navTo('./money/wallet')">
  21. <text>支付金额</text>
  22. <text class="num">{{ orderNum.todayPrice || '0' }}</text>
  23. <text>昨日:{{orderNum.proPrice}}</text>
  24. </view>
  25. <!-- <view class="tj-item" @click="navTo('/pages/user/award/award')">
  26. <text>会员数</text>
  27. <text class="num">{{ orderNum.proPrice || '0' }}</text>
  28. <text>昨日:{{orderNum.proPrice}}</text>
  29. </view> -->
  30. <view class="tj-item" @click="navTo('/pages/user/scoreAccumulate')">
  31. <text>支付订单数</text>
  32. <text class="num">{{ orderNum.todayCount || '0' }}</text>
  33. <text>昨日:{{orderNum.proCount}}</text>
  34. </view>
  35. </view>
  36. <!-- 订单 -->
  37. <view class="item-box">
  38. <view class="box-title flex">
  39. <view class="title"><text>店铺订单</text></view>
  40. <!-- <view class="link" @click="navTo('/pages/shop/shopOrder?state=0')" hover-class="common-hover">
  41. <text>全部</text>
  42. <text class="iconfont iconenter"></text>
  43. </view> -->
  44. </view>
  45. <view class="order-section">
  46. <view class="order-item" @click="navTo('/pages/shop/shopOrder?state=0')"
  47. hover-class="common-hover" :hover-stay-time="50">
  48. <view class=" icon position-relative">
  49. <view class="numOrderItem font-color-gray">
  50. {{orderNum.unpaid_count}}
  51. </view>
  52. </view>
  53. <text>待付款</text>
  54. </view>
  55. <view class="order-item" @click="navTo('/pages/shop/shopOrder?state=1')"
  56. hover-class="common-hover" :hover-stay-time="50">
  57. <view class=" icon position-relative">
  58. <view class="numOrderItem font-color-red">
  59. {{orderNum.unshipped_count}}
  60. </view>
  61. </view>
  62. <text>待发货</text>
  63. </view>
  64. <view class="order-item" @click="navTo('/pages/shop/shopOrder?state=2')"
  65. hover-class="common-hover" :hover-stay-time="50">
  66. <view class="icon position-relative">
  67. <view class="numOrderItem font-color-gray">
  68. {{orderNum.received_count}}
  69. </view>
  70. </view>
  71. <text>已发货</text>
  72. </view>
  73. <!-- <view class="order-item" @click="navTo('/pages/shop/shopOrderAfter?state=3')"
  74. hover-class="common-hover" :hover-stay-time="50">
  75. <view class="icon position-relative">
  76. <view class="numOrderItem font-color-yellow">
  77. {{orderNum.refund_count}}
  78. </view>
  79. </view>
  80. <text>待售后</text>
  81. </view> -->
  82. </view>
  83. </view>
  84. <view class="listBox">
  85. <view class="list">
  86. <view class="flex listItem" @click="navTo('/pages/shop/repair/clientRepair')" v-if="type==1">
  87. <view class="flex titleBox">
  88. <image class="listIconImg" src="../../static/icon/myWx.png" mode="widthFix"></image>
  89. <text class="title">客户报修</text>
  90. </view>
  91. <view class="right flex" v-if="question>0">
  92. <text class="numbox">{{question}}</text>
  93. <!-- <image class="img" src="../../static/icon/next1.png" mode="widthFix"></image> -->
  94. </view>
  95. </view>
  96. <view class="flex listItem" @click="navTo('/pages/shop/repair/repairHistory')">
  97. <view class="flex titleBox">
  98. <image class="listIconImg" src="../../static/icon/myWx.png" mode="widthFix"></image>
  99. <text class="title">维修历史</text>
  100. </view>
  101. <!-- <view class="right flex" v-if="question>0">
  102. <text class="numbox">{{question}}</text>
  103. </view> -->
  104. </view>
  105. <!-- <view class="flex listItem" @click="navTo('/pages/set/set')">
  106. <view class="flex titleBox">
  107. <image class="listIconImg" src="../../static/icon/shopMoney.png" mode="widthFix">
  108. </image>
  109. <text class="title">店铺钱包</text>
  110. </view>
  111. <view class="right flex">
  112. <text></text>
  113. </view>
  114. </view> -->
  115. <view class="flex listItem" @click="navTo('/pages/shop/repair/taskClientRepair')">
  116. <view class="flex titleBox">
  117. <image class="listIconImg" src="../../static/icon/myWx.png" mode="widthFix"></image>
  118. <text class="title">维修任务</text>
  119. </view>
  120. <view class="right flex" v-if="tesk>0">
  121. <text class="numbox">{{tesk}}</text>
  122. <!-- <image class="img" src="../../static/icon/next1.png" mode="widthFix"></image> -->
  123. </view>
  124. </view>
  125. <!-- <view class="flex listItem" @click="navTo('/pages/set/set')">
  126. <view class="flex titleBox">
  127. <image class="listIconImg" src="../../static/icon/myServer.png" mode="widthFix"></image>
  128. <text class="title">联系平台</text>
  129. </view>
  130. <view class="right flex">
  131. <text></text>
  132. </view>
  133. </view> -->
  134. <view class="flex listItem" @click="navTo('/pages/set/set')">
  135. <view class="flex titleBox">
  136. <image class="listIconImg" src="../../static/icon/mySet.png" mode="widthFix"></image>
  137. <text class="title">设置</text>
  138. </view>
  139. <view class="right flex">
  140. <text></text>
  141. <!-- <image class="img" src="../../static/icon/next1.png" mode="widthFix"></image> -->
  142. </view>
  143. </view>
  144. </view>
  145. </view>
  146. <view class="tapBottom" @click="changeTab">
  147. 前往用户界面
  148. </view>
  149. </view>
  150. </scroll-view>
  151. </view>
  152. </template>
  153. <script>
  154. import {
  155. mapState,
  156. mapMutations
  157. } from 'vuex';
  158. import {
  159. statistics,
  160. funds,
  161. question,
  162. adminStore,
  163. task
  164. } from '@/api/shop.js';
  165. import {
  166. saveUrl,
  167. interceptor
  168. } from '@/utils/loginUtils.js';
  169. export default {
  170. data() {
  171. return {
  172. type: 0, //0为数据未加载,1为门店2为店员
  173. orderNum: {
  174. unpaid_count: 0, //待支付
  175. unshipped_count: 0, //待发货
  176. received_count: 0, //待收获
  177. refund_count: 0, //待售后
  178. todayPrice: 0, //今日成交额
  179. todayCount: 0, //今日订单数
  180. proPrice: 0, //昨日成交额
  181. proCount: 0, //昨日订单数
  182. },
  183. question: 0, //维修数量
  184. tesk: 0, //维修任务数量
  185. };
  186. },
  187. computed: {
  188. ...mapState('user', ['hasLogin']),
  189. ...mapState('shop', ['shopAction'])
  190. },
  191. created() {
  192. this.type = this.shopAction.type
  193. },
  194. methods: {
  195. ...mapMutations('shop', ['setShopAction']),
  196. // 重新加载数据
  197. getInit() {
  198. const that = this;
  199. // 订单数
  200. statistics().then((e) => {
  201. that.orderNum = e.data
  202. })
  203. // 门店资金
  204. funds().then((e) => {
  205. that.name = e.data.name;
  206. that.logo = e.data.image;
  207. // 保存商店数据
  208. if (e.data.address) {
  209. e.data.type = 1;
  210. that.setShopAction(e.data);
  211. } else {
  212. e.data.type = 2;
  213. adminStore().then((ar) => {
  214. that.setShopAction(ar.data);
  215. }).catch((e) => {
  216. console.log(e);
  217. })
  218. }
  219. that.type = e.data.type;
  220. })
  221. // 查询店长客户报修数量
  222. question().then((e) => {
  223. that.question = e.data.count
  224. })
  225. // 查询维修任务数量
  226. task().then((e) => {
  227. that.tesk = e.data.count;
  228. }).catch((e) => {
  229. console.log(e);
  230. })
  231. },
  232. // 界面切换
  233. changeTab() {
  234. this.$emit('tab', false)
  235. },
  236. navTo(url) {
  237. if (!this.hasLogin) {
  238. // 保存地址
  239. saveUrl();
  240. // 登录拦截
  241. interceptor();
  242. } else {
  243. uni.navigateTo({
  244. url
  245. });
  246. }
  247. },
  248. }
  249. };
  250. </script>
  251. <style lang="scss">
  252. page {
  253. height: 100%;
  254. }
  255. .tapBottom {
  256. margin: 0 50rpx;
  257. text-align: center;
  258. color: #FFFFFF;
  259. border: 1px solid $color-green;
  260. background-color:$color-green ;
  261. line-height: 1;
  262. padding: 25rpx;
  263. border-radius: 100rpx;
  264. margin-top: 50rpx;
  265. }
  266. .listBox {
  267. margin-top: 20rpx;
  268. background-color: #FFFFFF;
  269. border-radius: 20rpx;
  270. overflow: hidden;
  271. }
  272. .list {
  273. .listItem {
  274. padding: 35rpx 40rpx;
  275. border-bottom: 1px solid $page-color-light;
  276. }
  277. .listIconImg {
  278. width: 36rpx;
  279. height: 36rpx;
  280. }
  281. .right {
  282. .img {
  283. width: 26rpx;
  284. }
  285. .numbox {
  286. background-color: $color-red;
  287. color: #FFFFFF;
  288. font-size: 22rpx;
  289. border-radius: 100rpx;
  290. min-width: 36rpx;
  291. height: 36rpx;
  292. line-height: 36rpx;
  293. text-align: center;
  294. padding: 0 5rpx;
  295. }
  296. }
  297. .titleBox {
  298. .title {
  299. padding-left: 20rpx;
  300. color: $font-color-base;
  301. font-size: $font-base;
  302. }
  303. }
  304. }
  305. %flex-center {
  306. display: flex;
  307. flex-direction: column;
  308. justify-content: center;
  309. align-items: center;
  310. }
  311. %section {
  312. display: flex;
  313. justify-content: space-around;
  314. align-content: center;
  315. border-radius: 10rpx;
  316. }
  317. .container {
  318. height: 100%;
  319. background-color: $page-color-base;
  320. }
  321. .content-box {
  322. height: 100%;
  323. }
  324. .vheigh {
  325. height: var(--status-bar-height);
  326. }
  327. .user-section {
  328. padding: 15rpx 30rpx 0;
  329. position: relative;
  330. }
  331. .user-info-box {
  332. height: 180rpx;
  333. color: white;
  334. display: flex;
  335. align-items: center;
  336. justify-content: space-between;
  337. position: relative;
  338. z-index: 1;
  339. .detail {
  340. height: 130rpx;
  341. .portrait-box {
  342. height: 100%;
  343. .portrait {
  344. width: 130rpx;
  345. height: 100%;
  346. border: 5rpx solid #fff;
  347. border-radius: 50%;
  348. }
  349. }
  350. .info-box {
  351. margin-left: 20rpx;
  352. line-height: 1.5;
  353. .username {
  354. font-size: 40rpx;
  355. color: $font-color-dark;
  356. font-weight: bold;
  357. height: 100%;
  358. }
  359. .authentication {
  360. border: 2rpx solid #FF4241;
  361. border-radius: 20px;
  362. padding: 0 25rpx;
  363. font-size: 24rpx;
  364. color: #FF4241;
  365. float: left;
  366. &.success {
  367. border: 2rpx solid $color-green;
  368. color: $color-green;
  369. }
  370. }
  371. }
  372. }
  373. }
  374. .cover-container {
  375. padding: 0 30rpx;
  376. position: relative;
  377. padding-bottom: 20rpx;
  378. }
  379. .tj-sction {
  380. @extend %section;
  381. .tj-item {
  382. @extend %flex-center;
  383. flex-direction: column;
  384. height: 100rpx;
  385. font-size: $font-sm;
  386. color: $font-color-light;
  387. }
  388. .num {
  389. font-size: $font-base;
  390. color: $font-color-dark;
  391. margin-bottom: 8rpx;
  392. font-weight: bold;
  393. }
  394. }
  395. .item-box {
  396. border-radius: 20rpx;
  397. background-color: white;
  398. margin-top: 20rpx;
  399. .box-title {
  400. line-height: 1;
  401. padding: 30rpx;
  402. .title {
  403. font-size: $font-lg;
  404. font-weight: bold;
  405. }
  406. .link {
  407. font-size: $font-base - 2rpx;
  408. color: $font-color-light;
  409. }
  410. }
  411. .order-section {
  412. @extend %section;
  413. padding: 28rpx 0;
  414. padding-top: 0;
  415. .order-item {
  416. @extend %flex-center;
  417. width: 120rpx;
  418. height: 120rpx;
  419. border-radius: 10rpx;
  420. font-size: $font-sm;
  421. color: $font-color-dark;
  422. .numOrderItem {
  423. font-size: 36rpx;
  424. font-weight: bold;
  425. text-align: center;
  426. }
  427. }
  428. .iconfont {
  429. font-size: 48rpx;
  430. margin-bottom: 18rpx;
  431. color: #fa436a;
  432. }
  433. .icon-shouhoutuikuan {
  434. font-size: 44rpx;
  435. }
  436. .icon {
  437. height: 50rpx;
  438. width: 48rpx;
  439. margin-bottom: 18rpx;
  440. background-size: 100%;
  441. background-repeat: no-repeat;
  442. background-position: center;
  443. .icon-img {
  444. width: 100%;
  445. height: 100%;
  446. }
  447. }
  448. }
  449. }
  450. .history-section {
  451. // padding: 30rpx 0 0;
  452. margin-top: 20rpx;
  453. background: #fff;
  454. border-radius: 10rpx;
  455. .h-list {
  456. white-space: nowrap;
  457. padding: 30rpx 30rpx 0;
  458. .h-list-image {
  459. display: inline-block;
  460. width: 160rpx;
  461. height: 160rpx;
  462. margin-right: 20rpx;
  463. border-radius: 10rpx;
  464. }
  465. }
  466. }
  467. </style>