index.vue 11 KB

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