珠宝小程序前端代码
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

57 lines
1.0 KiB

3 months ago
3 months ago
3 months ago
3 months ago
3 months ago
  1. <template>
  2. <!-- 公告 -->
  3. <view class="page">
  4. <navbar title="活动" leftClick @leftClick="$utils.navigateBack" />
  5. <view style="padding: 20rpx;">
  6. <uv-parse :content="notice"></uv-parse>
  7. </view>
  8. </view>
  9. </template>
  10. <script>
  11. export default {
  12. data() {
  13. return {
  14. notice : {},
  15. id : 0,
  16. title : '公告',
  17. titles : ['公司介绍', '产品介绍', '关于我们', '其他'],
  18. }
  19. },
  20. onLoad({id, type}) {
  21. if(type){
  22. this.title = this.titles[type]
  23. }
  24. if(id){
  25. this.id = id
  26. this.getInfoIntroduce()
  27. }else{
  28. this.getRiceNoticeList()
  29. }
  30. },
  31. methods: {
  32. // 获取公告
  33. getRiceNoticeList(){
  34. this.$api('getRiceNoticeList', res => {
  35. if(res.code == 200){
  36. this.notice = res.result.content
  37. }
  38. })
  39. },
  40. // 获取相关介绍
  41. getInfoIntroduce(){
  42. this.$api('getRiceAdDetail', {
  43. id : this.id
  44. }, res => {
  45. if(res.code == 200){
  46. this.notice = res.result.details
  47. }
  48. })
  49. },
  50. }
  51. }
  52. </script>
  53. <style scoped lang="scss">
  54. .page {
  55. }
  56. </style>