monthly-policy.vue 1.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970
  1. <template>
  2. <view>
  3. <!-- 月度政策 -->
  4. <view class="picture" 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 lang="scss" scoped>
  60. .picture{
  61. width: 100%;
  62. p{
  63. img{
  64. width: 100%;
  65. }
  66. }
  67. }
  68. </style>