productLink.vue 1.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172
  1. <template>
  2. <view>
  3. <view class="form">
  4. <view class="form-item-title">产品标题</view>
  5. <view class="form-input-box">
  6. <input placeholder-class="form-input-placeholder" placeholder="请输入产品标题"/>
  7. </view>
  8. <view class="form-item-title">产品链接</view>
  9. <view class="form-input-box ddflex">
  10. <input class="flex" v-model="productLink" placeholder-class="form-input-placeholder" placeholder="请填写或粘贴产品链接"/>
  11. <view class="clear-btn">清空</view>
  12. </view>
  13. <view class="next-btn" @click="submit">保存</view>
  14. </view>
  15. </view>
  16. </template>
  17. <script>
  18. const app = getApp();
  19. const req = require("../../utils/request.js");
  20. export default {
  21. components: {},
  22. props: {},
  23. data() {
  24. return {
  25. systems: {},
  26. isTop:0,
  27. productLink:''
  28. }
  29. },
  30. onLoad(options) {
  31. },
  32. onShow() {
  33. },
  34. methods: {
  35. submit(){
  36. let pages = getCurrentPages();
  37. var prevPage = pages[pages.length - 2];
  38. if (prevPage) {
  39. prevPage.$vm.setData({
  40. productLink: this.productLink
  41. });
  42. }
  43. }
  44. },
  45. mounted() {
  46. const systemInfo = uni.getSystemInfoSync();
  47. // px转换到rpx的比例
  48. let pxToRpxScale = 750 / systemInfo.windowWidth;
  49. let systems = {
  50. ktxStatusHeight: systemInfo.statusBarHeight * pxToRpxScale, // 状态栏的高度
  51. navigationHeight: 44 * pxToRpxScale // 导航栏的高度
  52. };
  53. systems.barHeight = systems.ktxStatusHeight + systems.navigationHeight;
  54. this.systems = systems;
  55. },
  56. onPageScroll: function(e) {
  57. if (e.scrollTop > this.systems.barHeight) {
  58. this.isTop = 1;
  59. } else {
  60. this.isTop = 0;
  61. }
  62. }
  63. }
  64. </script>
  65. <style>
  66. @import "./productLink.css";
  67. </style>