index.vue 15 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510
  1. <template>
  2. <view style="background-color: #ffffff; height: 100%" class="u-skeleton">
  3. <view class="u-page status_bar">
  4. <view class="head">
  5. <view class="status_bar">
  6. <!-- 这里是状态栏 -->
  7. </view>
  8. <view class="u-flex u-row-between" style="padding: 30rpx 40rpx">
  9. <view class="u-flex">
  10. <view class="u-skeleton-circle">
  11. <u-image
  12. width="130rpx"
  13. height="130rpx"
  14. :src="userInfo.storeImageUrl"
  15. :lazy-load="true"
  16. shape="circle"
  17. >
  18. <view
  19. slot="error"
  20. style="font-size: 24rpx"
  21. :fade="true"
  22. duration="450"
  23. >加载失败
  24. </view>
  25. </u-image>
  26. </view>
  27. <view class="u-margin-left-10 u-skeleton-fillet">
  28. <view
  29. style="color: #fff; font-size: 40rpx"
  30. class="u-margin-bottom-20"
  31. >
  32. <text class="more_text">{{ userInfo.storeName }}</text>
  33. </view>
  34. <view
  35. style="
  36. border: 1rpx solid #e3e3e3;
  37. border-radius: 30rpx;
  38. font-size: 24rpx;
  39. color: #fff;
  40. padding: 2rpx 20rpx;
  41. text-align: center;
  42. "
  43. >
  44. {{ userInfo.province }}{{ userInfo.city }}{{ userInfo.district
  45. }}{{ userInfo.addressInfo }}
  46. </view>
  47. </view>
  48. </view>
  49. <view class="u-skeleton-fillet" @click="showQr = !showQr">
  50. <!-- <u-icon name="qr" size="80rpx" custom-prefix="van-icon" color="#fff"></u-icon> -->
  51. <u-image
  52. width="60rpx"
  53. height="60rpx"
  54. src="../../static/sailun/qrcode.png"
  55. :lazy-load="true"
  56. >
  57. </u-image>
  58. </view>
  59. </view>
  60. <view class="u-flex u-row-around u-m-t-20">
  61. <view class="u-text-center u-skeleton-fillet">
  62. <view style="font-size: 34rpx; color: #ffffff">
  63. {{ userInfo.contactName }}
  64. </view>
  65. <view style="color: #b3daff; opacity: 0.9"> 联系人 </view>
  66. </view>
  67. <view class="u-text-center u-skeleton-fillet">
  68. <view style="font-size: 34rpx; color: #ffffff">
  69. {{ userInfo.district }}
  70. </view>
  71. <view style="color: #b3daff; opacity: 0.9"> 区域 </view>
  72. </view>
  73. </view>
  74. </view>
  75. <view style="position: relative; top: -110rpx; margin-bottom: 100rpx">
  76. <u-card
  77. padding="20"
  78. box-shadow="0rpx 0rpx 24rpx 0rpx rgba(101, 176, 249, 0.41)"
  79. border-radius="20"
  80. :show-foot="false"
  81. :border="false"
  82. class="u-skeleton-fillet"
  83. >
  84. <view slot="head" class="u-flex u-row-between u-col-bottom">
  85. <view style="font-size: 34rpx"> 结算中心 </view>
  86. <view
  87. class="u-col-bottom"
  88. @click="insettlement"
  89. style="color: #4b4b4b; font-size: 24rpx"
  90. >
  91. 查看全部
  92. </view>
  93. </view>
  94. <view slot="body">
  95. <view class="u-flex u-row-around">
  96. <view class="u-text-center">
  97. <view style="color: #0095ff; font-size: 30rpx">
  98. {{ userInfo.usableMoney | numberFormat }}
  99. </view>
  100. <view style="color: #333333"> 我的奖励 </view>
  101. </view>
  102. <view class="u-text-center">
  103. <view style="color: #0095ff; font-size: 30rpx">
  104. {{ userInfo.blockMoney | numberFormat }}
  105. </view>
  106. <view style="color: #333333"> 冻结奖励 </view>
  107. </view>
  108. <view class="u-text-center">
  109. <view style="color: #0095ff; font-size: 30rpx">
  110. {{ userInfo.allBlockMoney | numberFormat }}
  111. </view>
  112. <view style="color: #333333"> 待核销 </view>
  113. </view>
  114. <view class="u-text-center">
  115. <view style="color: #0095ff; font-size: 30rpx">
  116. {{ userInfo.storeTotalIntegral | numberFormat }}
  117. </view>
  118. <view style="color: #333333"> 可用积分 </view>
  119. </view>
  120. </view>
  121. </view>
  122. </u-card>
  123. <u-card
  124. padding="20"
  125. box-shadow="0rpx 0rpx 24rpx 0rpx rgba(101, 176, 249, 0.41)"
  126. border-radius="20"
  127. :show-foot="false"
  128. :border="false"
  129. class="u-skeleton-fillet"
  130. >
  131. <view slot="head" class="u-flex u-row-between u-col-bottom">
  132. <view style="font-size: 34rpx"> 我的服务 </view>
  133. </view>
  134. <view slot="body">
  135. <view
  136. class="u-flex u-row-around u-flex-wrap u-col-between"
  137. style="height: 300rpx; font-size: 24rpx"
  138. >
  139. <view
  140. class="u-flex u-row-centter"
  141. style="flex-direction: column; width: 25%"
  142. @click="inPage(0)"
  143. >
  144. <view>
  145. <u-image
  146. width="80rpx"
  147. height="80rpx"
  148. src="../../static/sailun/instock.png"
  149. :lazy-load="true"
  150. shape="circle"
  151. >
  152. </u-image>
  153. </view>
  154. <view style="color: #000000" class="u-m-t-10"> 入库明细 </view>
  155. </view>
  156. <view
  157. class="u-flex u-row-centter"
  158. style="flex-direction: column; width: 25%"
  159. @click="inPage(1)"
  160. >
  161. <view>
  162. <u-image
  163. width="80rpx"
  164. height="80rpx"
  165. src="../../static/sailun/outstock.png"
  166. :lazy-load="true"
  167. shape="circle"
  168. >
  169. </u-image>
  170. </view>
  171. <view style="color: #000000" class="u-m-t-10"> 出库明细 </view>
  172. </view>
  173. <view
  174. class="u-flex u-row-centter"
  175. style="flex-direction: column; width: 25%"
  176. @click="inPage(2)"
  177. >
  178. <view>
  179. <u-image
  180. width="80rpx"
  181. height="80rpx"
  182. src="../../static/sailun/reward.png"
  183. :lazy-load="true"
  184. shape="circle"
  185. >
  186. </u-image>
  187. </view>
  188. <view style="color: #000000" class="u-m-t-10"> 奖励明细 </view>
  189. </view>
  190. <view
  191. class="u-flex u-row-centter"
  192. style="flex-direction: column; width: 25%"
  193. @click="inPage(3)"
  194. >
  195. <view>
  196. <u-image
  197. width="80rpx"
  198. height="80rpx"
  199. src="../../static/sailun/task.png"
  200. :lazy-load="true"
  201. shape="circle"
  202. >
  203. </u-image>
  204. </view>
  205. <view style="color: #000000" class="u-m-t-10"> 任务统计 </view>
  206. </view>
  207. <view
  208. class="u-flex u-row-centter"
  209. style="flex-direction: column; width: 25%"
  210. @click="inPage(4)"
  211. >
  212. <view>
  213. <u-image
  214. width="80rpx"
  215. height="80rpx"
  216. src="../../static/sailun/tirenum.png"
  217. :lazy-load="true"
  218. shape="circle"
  219. >
  220. </u-image>
  221. </view>
  222. <view style="color: #000000" class="u-m-t-10"> 胎号查询 </view>
  223. </view>
  224. <view
  225. class="u-flex u-row-centter"
  226. style="flex-direction: column; width: 25%"
  227. @click="inPage(5)"
  228. >
  229. <view>
  230. <u-image
  231. width="80rpx"
  232. height="80rpx"
  233. src="../../static/sailun/me-order.png"
  234. :lazy-load="true"
  235. shape="circle"
  236. >
  237. </u-image>
  238. </view>
  239. <view style="color: #000000" class="u-m-t-10"> 门店订单 </view>
  240. </view>
  241. <view
  242. class="u-flex u-row-centter"
  243. style="flex-direction: column; width: 25%"
  244. @click="inPage(6)"
  245. >
  246. <view>
  247. <u-image
  248. width="80rpx"
  249. height="80rpx"
  250. src="../../static/sailun/coupon.png"
  251. :lazy-load="true"
  252. shape="circle"
  253. >
  254. </u-image>
  255. </view>
  256. <view style="color: #000000" class="u-m-t-10">
  257. 我的优惠券
  258. </view>
  259. </view>
  260. <view
  261. class="u-flex u-row-centter"
  262. style="flex-direction: column; width: 25%"
  263. @click="inPage(7)"
  264. >
  265. <view>
  266. <u-image
  267. width="80rpx"
  268. height="80rpx"
  269. src="../../static/sailun/supplier.png"
  270. :lazy-load="true"
  271. shape="circle"
  272. >
  273. </u-image>
  274. </view>
  275. <view style="color: #000000" class="u-m-t-10">
  276. 我的供应商
  277. </view>
  278. </view>
  279. </view>
  280. </view>
  281. </u-card>
  282. <u-cell-group>
  283. <u-cell-item title="核销记录" @click="inPage(8)">
  284. <u-icon
  285. slot="icon"
  286. size="42"
  287. name="balance-o"
  288. custom-prefix="van-icon"
  289. ></u-icon>
  290. </u-cell-item>
  291. <u-cell-item title="兑换记录" @click="inPage(9)">
  292. <u-icon
  293. slot="icon"
  294. size="42"
  295. name="balance-list-o"
  296. custom-prefix="van-icon"
  297. ></u-icon>
  298. </u-cell-item>
  299. <u-cell-item title="经销商库存" @click="inPage(10)">
  300. <u-icon
  301. slot="icon"
  302. size="42"
  303. name="points"
  304. custom-prefix="van-icon"
  305. ></u-icon>
  306. </u-cell-item>
  307. <u-cell-item title="设置" @click="inPage(11)">
  308. <u-icon
  309. slot="icon"
  310. size="42"
  311. name="setting-o"
  312. custom-prefix="van-icon"
  313. ></u-icon>
  314. </u-cell-item>
  315. </u-cell-group>
  316. </view>
  317. </view>
  318. <u-modal
  319. v-model="showQr"
  320. :show-title="false"
  321. :mask-close-able="true"
  322. :show-confirm-button="false"
  323. width="440"
  324. >
  325. <view class="slot-content u-p-40 u-flex u-row-center">
  326. <u-image
  327. width="360rpx"
  328. height="360rpx"
  329. :src="userInfo.qrbarcodeSrc"
  330. ></u-image>
  331. </view>
  332. </u-modal>
  333. <u-skeleton :loading="loading" :animation="true"></u-skeleton>
  334. </view>
  335. </template>
  336. <script>
  337. import { mapState, mapMutations } from "vuex";
  338. import { request } from "../../common/request/request";
  339. require("promise.prototype.finally").shim();
  340. export default {
  341. data() {
  342. return {
  343. userInfo: "",
  344. showQr: false,
  345. loading: true, // 是否显示骨架屏组件
  346. };
  347. },
  348. filters: {
  349. numberFormat(value) {
  350. let unit = "";
  351. if (value) {
  352. var k = 10000,
  353. sizes = ["", "万", "亿", "万亿"],
  354. i;
  355. if (value < k) {
  356. value = value;
  357. } else {
  358. i = Math.floor(Math.log(value) / Math.log(k));
  359. value = (value / Math.pow(k, i)).toFixed(2);
  360. unit = sizes[i];
  361. }
  362. return value + unit;
  363. } else {
  364. return 0;
  365. }
  366. },
  367. },
  368. computed: {
  369. ...mapState(["undataStore"]),
  370. },
  371. created() {
  372. this.getMyinfo();
  373. },
  374. onShow() {
  375. if (this.undataStore) {
  376. this.getMyinfo();
  377. }
  378. },
  379. methods: {
  380. ...mapMutations(["outStore"]),
  381. getMyinfo() {
  382. request({
  383. url: "/myapp/selectStore",
  384. method: "post",
  385. data: {
  386. storeId: this.$store.state.storeInfo.storeId,
  387. },
  388. })
  389. .then((res) => {
  390. this.userInfo = res.data.data;
  391. })
  392. .catch((err) => {
  393. console.log(err);
  394. })
  395. .finally(() => {
  396. this.loading = false;
  397. this.outStore();
  398. uni.hideLoading();
  399. });
  400. },
  401. inPage(index) {
  402. switch (index) {
  403. case 0: {
  404. this.$u.route({
  405. url: "pages/me/Warehousing-details/index",
  406. });
  407. break;
  408. }
  409. case 1: {
  410. this.$u.route({
  411. url: "pages/me/Delivery-details/index",
  412. });
  413. break;
  414. }
  415. case 2: {
  416. this.$u.route({
  417. url: "pages/me/Reward-details/index",
  418. });
  419. break;
  420. }
  421. case 3: {
  422. this.$u.route({
  423. url: "pages/me/Statistical-task/index",
  424. });
  425. break;
  426. }
  427. case 4: {
  428. this.$u.route({
  429. url: "pages/me/scancodequery/result",
  430. });
  431. break;
  432. }
  433. case 5: {
  434. this.$u.toast("门店订单暂不开放");
  435. // this.$u.route({
  436. // url: 'pages/me/my-order/my-order',
  437. // })
  438. break;
  439. }
  440. case 6: {
  441. this.$u.toast("我的优惠券暂不开放");
  442. // this.$u.route({
  443. // url: 'pages/me/coupon',
  444. // })
  445. break;
  446. }
  447. case 7: {
  448. this.$u.route({
  449. url: "pages/me/suppliers",
  450. });
  451. break;
  452. }
  453. case 8: {
  454. this.$u.route({
  455. url: "pages/me/Write-off-management/index",
  456. });
  457. break;
  458. }
  459. case 9: {
  460. this.$u.toast("兑换记录暂不开放");
  461. break;
  462. }
  463. case 10: {
  464. this.$u.route({
  465. url: "pages/me/agent-stock/agent-stock",
  466. });
  467. break;
  468. }
  469. case 11: {
  470. this.$u.route({
  471. url: "pages/me/setting/setting",
  472. });
  473. break;
  474. }
  475. }
  476. },
  477. // 查看结算
  478. insettlement() {
  479. this.$u.route({
  480. url: "pages/me/Settlement-center/index",
  481. });
  482. },
  483. },
  484. };
  485. </script>
  486. <style lang="scss" scoped>
  487. .status_bar {
  488. height: var(--status-bar-height);
  489. }
  490. .head {
  491. width: 750rpx;
  492. min-height: 460rpx;
  493. background-image: url(../../static/sailun/mebg.png);
  494. background-size: 100% 100%;
  495. }
  496. .more_text {
  497. text-overflow: ellipsis;
  498. overflow: hidden;
  499. display: -webkit-box;
  500. -webkit-line-clamp: 1;
  501. /*设置显示行数,此处为2行*/
  502. -webkit-box-orient: vertical;
  503. width: 450rpx;
  504. }
  505. </style>