homecolumn.vue 1.9 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677
  1. <template>
  2. <view>
  3. <!--components/special/special.wxml-->
  4. <!-- 专栏 -->
  5. <template name="homecolumn">
  6. <view class="mt20 bgfff r10 dflex idxnav" v-if="homecolumnimg.length==3">
  7. <navigator url="/pages/live/live" open-type="switchTab" hover-class="none" class="zbgm">
  8. <image :src="homecolumnimg[0] + '?x-oss-process=style/w375'"></image>
  9. </navigator>
  10. <view>
  11. <view class="lqzx" @tap="toCoupon">
  12. <image :src="homecolumnimg[1] + '?x-oss-process=style/w375'"></image>
  13. </view>
  14. <view class="myzx">
  15. <contact-button :img-url="homecolumnimg[2] + '?x-oss-process=style/w375'"></contact-button>
  16. </view>
  17. <!-- <navigator url="/pages/timelyDelivery/index" open-type="navigate" hover-class="none" class="zbgm" wx:if="{{Is_Store_Price_Stock==1}}">
  18. <image src="{{homecolumnimg[0] + '?x-oss-process=style/w375'}}"></image>
  19. </navigator> -->
  20. </view>
  21. </view>
  22. </template>
  23. </view>
  24. </template>
  25. <script>
  26. // components/special/special.js
  27. // 专区
  28. const app = getApp();
  29. const req = require("../../utils/request.js");
  30. export default {
  31. data() {
  32. return {
  33. };
  34. },
  35. components: {},
  36. props: {
  37. homecolumnimg: Array //首页专区图片
  38. },
  39. watch: {},
  40. methods: {
  41. getRqeDatas() {
  42. let that = this; //首页专区
  43. let homecolumn = this.homeTemplate.filter(it => it.module == this.templateType.module_homecolumn);
  44. if (homecolumn.length > 0 && homecolumn[0].state == 0) {
  45. let homecolumnimg = homecolumn[0].contentId.split(",");
  46. if (homecolumnimg[0] != '' && homecolumnimg[1] != '' && homecolumnimg[2] != '') {
  47. if (homecolumnimg.length == 3) {
  48. // console.log(homecolumnimg);
  49. this.setData({
  50. homecolumnimg: homecolumnimg
  51. });
  52. }
  53. }
  54. }
  55. },
  56. toCoupon() {
  57. req.isLogin().then(success => {
  58. if (success) {
  59. app.globalData.openPage('product/coupon/coupon');
  60. }
  61. });
  62. }
  63. }
  64. };
  65. </script>
  66. <style>
  67. @import "./homecolumn.css";
  68. </style>