cate.vue 3.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176
  1. <template>
  2. <view class="content" :class="['qn-page-' + theme]">
  3. <view :style="{ backgroundColor: cateModel === 4 ? '#ffffff' : '#f4f5f6' }" class="mp-search-box">
  4. <view @click="goPage('/pagesT/search/index')" :style="{ backgroundColor: cateModel !== 4 ? '#ffffff' : '#f4f5f6' }" class="ser-input-view">
  5. <text class="ibonfont ibonsousuo1"></text>
  6. <text>输入搜索商品发现更多好物…</text>
  7. </view>
  8. <view class="right-view">
  9. <!-- #ifdef MP-WEIXIN -->
  10. <button class="contact-btn" open-type="contact">
  11. <u-icon name="server-fill" color="#000000" size="32"></u-icon>
  12. <view>商城客服</view>
  13. </button>
  14. <!-- #endif -->
  15. <!-- #ifdef APP-PLUS || H5 -->
  16. <button class="contact-btn" @click="callphone">
  17. <u-icon name="server-fill" color="#000000" size="32"></u-icon>
  18. <view>客服</view>
  19. </button>
  20. <!-- #endif -->
  21. </view>
  22. </view>
  23. <view class="cate-main" :style="{ top: cateModel === 4 ? '100rpx' : '110rpx', zIndex: cateModel === 4 ? '1000' : '900' }">
  24. <cateOne v-if="cateModel === 1"></cateOne>
  25. <CateTwo v-if="cateModel === 2"></CateTwo>
  26. <CateThree v-if="cateModel === 3"></CateThree>
  27. <CateFive v-if="cateModel === 5"></CateFive>
  28. <CateFour :selAddress="now_sel_address" v-if="cateModel === 4" :isLogin="isLogin"></CateFour>
  29. </view>
  30. <!-- 底部tabbar -->
  31. <Tabbar v-model="current"></Tabbar>
  32. </view>
  33. </template>
  34. <script>
  35. import cateOne from './CateOne.vue';
  36. import CateTwo from './CateTwo.vue';
  37. import CateThree from './CateThree.vue';
  38. import CateFour from './CateFour.vue';
  39. import CateFive from './CateFive.vue';
  40. export default {
  41. components: {
  42. cateOne,
  43. CateTwo,
  44. CateThree,
  45. CateFour,
  46. CateFive
  47. },
  48. computed: {
  49. style() {
  50. const systemInfo = uni.getSystemInfoSync();
  51. return `top:${systemInfo.statusBarHeight + 44}px`;
  52. },
  53. enterprisemobile() {
  54. return this.$store.state.enterpriseInfo.mobile;
  55. },
  56. cateModel(){
  57. return this.$store.state.cateModel;
  58. }
  59. },
  60. onNavigationBarButtonTap() {
  61. this.goPage('/pagesT/search/index');
  62. },
  63. data() {
  64. return {
  65. current: 1,
  66. now_sel_address: {},
  67. conptop: {
  68. // #ifdef H5
  69. paddingTop: '44px',
  70. // #endif
  71. // #ifdef MP-WEIXIN
  72. paddingTop: '124rpx'
  73. // #endif
  74. },
  75. // cateModel: 4,
  76. isLogin: true
  77. };
  78. },
  79. onShow() {
  80. this.isLogin = this.$common.isLogin();
  81. // this.cateModel = this.$store.state.cateModel;
  82. },
  83. onLoad() {
  84. // #ifdef MP-WEIXIN
  85. // 小程序的原生菜单中显示分享按钮
  86. uni.showShareMenu({
  87. withShareTicket: false,
  88. menus: ['shareAppMessage', 'shareTimeline']
  89. });
  90. // #endif
  91. },
  92. methods: {
  93. callphone() {
  94. uni.makePhoneCall({
  95. phoneNumber: this.enterprisemobile
  96. });
  97. }
  98. },
  99. // 发送给朋友
  100. onShareAppMessage() {
  101. return {
  102. title: this.$store.state.baseSet.shop,
  103. path: '/pages/index/index?businessmanId=' + (this.$store.state.userStatus.id||''),
  104. success: res => {
  105. console.log(res);
  106. }
  107. };
  108. },
  109. // #ifdef MP-WEIXIN
  110. // 分享到朋友圈
  111. onShareTimeline(obj) {},
  112. // 收藏小程序
  113. onAddToFavorites() {}
  114. // #endif
  115. };
  116. </script>
  117. <style lang="scss">
  118. .content {
  119. height: 100vh;
  120. background-color: #fff;
  121. }
  122. .cate-main {
  123. position: fixed;
  124. left: 0;
  125. width: 100%;
  126. top: 110rpx;
  127. z-index: 997;
  128. }
  129. .mp-search-box {
  130. background-color: #f5f6f7;
  131. position: fixed;
  132. padding: 24upx 0;
  133. left: 0;
  134. top: 0;
  135. z-index: 9999;
  136. width: 100%;
  137. padding-left: 30rpx;
  138. .ser-input-view {
  139. width: 620rpx;
  140. height: 64rpx;
  141. background-color: #ffffff;
  142. border-radius: 64upx;
  143. line-height: 64upx;
  144. font-size: 24upx;
  145. color: #9fa8bd;
  146. font-weight: 400;
  147. .ibonfont {
  148. margin: 0 18rpx;
  149. display: inline-block;
  150. vertical-align: middle;
  151. font-size: 38rpx;
  152. }
  153. }
  154. .right-view {
  155. position: absolute;
  156. right: 16rpx;
  157. top: 50%;
  158. transform: translateY(-50%);
  159. .contact-btn {
  160. background-color: transparent;
  161. font-size: 18rpx;
  162. font-weight: 400;
  163. color: #2a2a2a;
  164. line-height: 25rpx;
  165. text-align: center;
  166. padding: 0;
  167. &::after {
  168. border: 0 none;
  169. }
  170. }
  171. }
  172. }
  173. </style>