contract.vue 1.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354
  1. <template>
  2. <view>
  3. <view class="banner" v-html="contract_info"></view>
  4. </view>
  5. </template>
  6. <script>
  7. import adoptApi from '@/api/home/index.js';
  8. export default {
  9. data() {
  10. return {
  11. primary:this.$theme.primary,
  12. contract_info: '',
  13. settingFile:getApp().globalData.siteinfo,
  14. };
  15. },
  16. onLoad(options) {
  17. // type1 甲方 2,合同
  18. if (options.type == 1) {
  19. adoptApi.partydetail({ id: options.id }).then(res => {
  20. if (res.status == 200) {
  21. uni.setNavigationBarTitle({ title: res.data.contract_info.title });
  22. this.contract_info=res.data.contract_info.content.replace(/\<img src="/gi,`<img style='width:100%;display:block' src="${this.settingFile.root_rich_img}`);
  23. } else {
  24. this.$api.msg(res.msg);
  25. }
  26. });
  27. } else {
  28. adoptApi
  29. .contract_tplinfo({
  30. contract_id: options.id ,
  31. goods_id:options.orderid,
  32. })
  33. .then(res => {
  34. if (res.status == 200) {
  35. uni.setNavigationBarTitle({ title: res.data.contract_info.title });
  36. this.contract_info = res.data.contract_info.replace(/\<img src="/gi,`<img style='width:100%' src="${this.settingFile.root_rich_img}`);
  37. } else {
  38. this.$api.msg(res.msg);
  39. }
  40. });
  41. }
  42. },
  43. methods: {}
  44. };
  45. </script>
  46. <style>
  47. .banner {
  48. padding: 0 25px;
  49. padding-top: 15px;
  50. line-height: 50rpx;
  51. }
  52. </style>