index.vue 11 KB

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