index.vue 12 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381
  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 v-if="this.$store.state.storeInfo.sourceFlag==1" title="修改地理位置" @click="inPage(12)">
  175. <u-icon slot="icon" size="42" name="points" custom-prefix="van-icon"></u-icon>
  176. </u-cell-item>
  177. <u-cell-item title="设置" @click="inPage(11)">
  178. <u-icon slot="icon" size="42" name="setting-o" custom-prefix="van-icon"></u-icon>
  179. </u-cell-item>
  180. </u-cell-group>
  181. </view>
  182. </view>
  183. <u-modal v-model="showQr" :show-title="false" :mask-close-able="true" :show-confirm-button="false" width="440">
  184. <view class="slot-content u-p-40 u-flex u-row-center">
  185. <u-image width="360rpx" height="360rpx" :src="userInfo.qrbarcodeSrc"></u-image>
  186. </view>
  187. </u-modal>
  188. <u-skeleton :loading="loading" :animation="true"></u-skeleton>
  189. </view>
  190. </template>
  191. <script>
  192. import {
  193. mapState,
  194. mapMutations
  195. } from "vuex";
  196. import {
  197. request
  198. } from "../../common/request/request";
  199. require("promise.prototype.finally").shim();
  200. export default {
  201. data() {
  202. return {
  203. userInfo: "",
  204. showQr: false,
  205. loading: true, // 是否显示骨架屏组件
  206. };
  207. },
  208. filters: {
  209. numberFormat(value) {
  210. let unit = "";
  211. if (value) {
  212. var k = 10000,
  213. sizes = ["", "万", "亿", "万亿"],
  214. i;
  215. if (value < k) {
  216. value = value;
  217. } else {
  218. i = Math.floor(Math.log(value) / Math.log(k));
  219. value = (value / Math.pow(k, i)).toFixed(2);
  220. unit = sizes[i];
  221. }
  222. return value + unit;
  223. } else {
  224. return 0;
  225. }
  226. },
  227. },
  228. computed: {
  229. ...mapState(["undataStore"]),
  230. },
  231. created() {
  232. this.getMyinfo();
  233. },
  234. onShow() {
  235. if (this.undataStore) {
  236. this.getMyinfo();
  237. }
  238. },
  239. methods: {
  240. ...mapMutations(["outStore"]),
  241. getMyinfo() {
  242. request({
  243. url: "/myapp/selectStore",
  244. method: "post",
  245. data: {
  246. storeId: this.$store.state.storeInfo.storeId,
  247. },
  248. })
  249. .then((res) => {
  250. this.userInfo = res.data.data;
  251. })
  252. .catch((err) => {
  253. console.log(err);
  254. })
  255. .finally(() => {
  256. this.loading = false;
  257. this.outStore();
  258. uni.hideLoading();
  259. });
  260. },
  261. inPage(index) {
  262. switch (index) {
  263. case 0:
  264. {
  265. this.$u.route({
  266. url: "pages/me/Warehousing-details/index",
  267. });
  268. break;
  269. }
  270. case 1:
  271. {
  272. this.$u.route({
  273. url: "pages/me/Delivery-details/index",
  274. });
  275. break;
  276. }
  277. case 2:
  278. {
  279. this.$u.route({
  280. url: "pages/me/Reward-details/index",
  281. });
  282. break;
  283. }
  284. case 3:
  285. {
  286. this.$u.route({
  287. url: "pages/me/Statistical-task/index",
  288. });
  289. break;
  290. }
  291. case 4:
  292. {
  293. this.$u.route({
  294. url: "pages/me/scancodequery/result",
  295. });
  296. break;
  297. }
  298. case 5:
  299. {
  300. this.$u.toast("门店订单暂不开放");
  301. // this.$u.route({
  302. // url: 'pages/me/my-order/my-order',
  303. // })
  304. break;
  305. }
  306. case 6:
  307. {
  308. this.$u.toast("我的优惠券暂不开放");
  309. // this.$u.route({
  310. // url: 'pages/me/coupon',
  311. // })
  312. break;
  313. }
  314. case 7:
  315. {
  316. this.$u.route({
  317. url: "pages/me/suppliers",
  318. });
  319. break;
  320. }
  321. case 8:
  322. {
  323. this.$u.route({
  324. url: "pages/me/Write-off-management/index",
  325. });
  326. break;
  327. }
  328. case 9:
  329. {
  330. this.$u.toast("兑换记录暂不开放");
  331. break;
  332. }
  333. case 10:
  334. {
  335. this.$u.route({
  336. url: "pages/me/agent-stock/agent-stock",
  337. });
  338. break;
  339. }
  340. case 11:
  341. {
  342. this.$u.route({
  343. url: "pages/me/setting/setting",
  344. });
  345. break;
  346. }
  347. }
  348. },
  349. // 查看结算
  350. insettlement() {
  351. this.$u.route({
  352. url: "pages/me/Settlement-center/index",
  353. });
  354. },
  355. },
  356. };
  357. </script>
  358. <style lang="scss" scoped>
  359. .status_bar {
  360. height: var(--status-bar-height);
  361. }
  362. .head {
  363. width: 750rpx;
  364. min-height: 460rpx;
  365. background-image: url(../../static/sailun/mebg.png);
  366. background-size: 100% 100%;
  367. }
  368. .more_text {
  369. text-overflow: ellipsis;
  370. overflow: hidden;
  371. display: -webkit-box;
  372. -webkit-line-clamp: 1;
  373. -webkit-box-orient: vertical;
  374. max-width: 400rpx;
  375. }
  376. </style>