monthly-policy.vue 1.2 KB

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