index.vue 11 KB

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