monthly-policy.vue 1.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364
  1. <template>
  2. <view>
  3. <!-- 月度政策 -->
  4. </view>
  5. </template>
  6. <script>
  7. import {
  8. request
  9. } from '@/common/request/request'
  10. require("promise.prototype.finally").shim()
  11. export default {
  12. data() {
  13. return {
  14. }
  15. },
  16. onLoad() {
  17. this.handleGetData();
  18. },
  19. methods: {
  20. handleGetData: function(){
  21. uni.showLoading({
  22. title: "加载中"
  23. });
  24. var _this = this;
  25. request({
  26. url: '/homepage/getArticleOne',
  27. method: 'post',
  28. data: {
  29. "displayType": "0" //门店1
  30. }
  31. }).then(res => {
  32. if(res.data.code==0){
  33. console.log(res)
  34. }else{
  35. console.log(res)
  36. uni.showToast({
  37. title: res.data.msg,
  38. icon: "none",
  39. duration: _this.$store.state.showToastDuration
  40. });
  41. }
  42. }).catch(err => {
  43. uni.showToast({
  44. title: _this.$store.state.showServerErrorMsg,
  45. icon: "none",
  46. duration: _this.$store.state.showToastDuration
  47. });
  48. }).finally(() => {
  49. setTimeout(() => {
  50. uni.hideLoading();
  51. this.loading = false;
  52. }, 1000)
  53. })
  54. }
  55. }
  56. }
  57. </script>
  58. <style>
  59. </style>