index.vue 6.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303
  1. <template>
  2. <div>
  3. <!-- #ifdef MP-WEIXIN -->
  4. <view class="header weiXinBox" :style="{'padding-top': topHeight + 'px'}">
  5. <view class="topBox" :style="{'height': height + 'px'}">
  6. <image class="logo" src="https://ceres.zkthink.com/static/assets/img/logo.png" mode="widthFix"></image>
  7. </view>
  8. </view>
  9. <view class="wxBtnBg" :style="{'padding-top': (topHeight + height + 10) + 'px'}">
  10. <view class="weiXinBoxBtn" @click="searchPro">
  11. <image class="search-icon" src="https://ceres.zkthink.com/static/images/searchImg.png" mode="widthFix">
  12. </image>
  13. <text>请输入您想要的宝贝</text>
  14. </view>
  15. </view>
  16. <!-- #endif -->
  17. <!-- #ifdef H5 || APP-PLUS -->
  18. <view class="header">
  19. <view class="topBox topWap">
  20. <image class="logo" src="https://ceres.zkthink.com/static/assets/img/logo.png" mode="widthFix"></image>
  21. <view class="search-btn" @click="searchPro">
  22. <image class="search-icon" src="https://ceres.zkthink.com/static/img/search.png" mode="widthFix">
  23. </image>
  24. </view>
  25. </view>
  26. </view>
  27. <!-- #endif -->
  28. <category-list @tabChange='tabChange'></category-list>
  29. <canvas-page v-if="activeTab==0" :terminal="terminal" :typeId="1"></canvas-page>
  30. <category-show v-else :categoryid="categoryid"></category-show>
  31. <ad-window ref="adWindow" :triggerCondition="1"></ad-window>
  32. <view class="reachBottom" v-if="topLeft > 400">
  33. <image class="reach-icon" src="https://ceres.zkthink.com/static/img/reachBottom.png" mode="widthFix">
  34. </image>
  35. <text class="reach-text">这里到底了哦~~</text>
  36. </view>
  37. <tui-modal :show="privacyShow" :custom="true" :fadein="true">
  38. <view class="Put-box1">
  39. <view class="text-align fs34 fs-bold">
  40. 协议与隐私政策
  41. </view>
  42. <p class="mar-top-20">欢迎来到cereshop!我们根据最新的法律、法规、监管政策要求,更新了cereshop隐私政策。</p>
  43. <view class="flex-display flex-sp-between">
  44. <view class="btn submit" @click="privacyShow = false">
  45. 同意
  46. </view>
  47. </view>
  48. </view>
  49. </tui-modal>
  50. </div>
  51. </template>
  52. <script>
  53. import tuiModal from "@/components/modal/modal";
  54. import AdWindow from "@/components/adWindow";
  55. const API = require('../../../config/api')
  56. import CategoryList from "@/components/basics/categoryList.vue"
  57. import CategoryShow from "@/components/basics/categoryShow.vue"
  58. import canvasPage from '@/components/canvasShow/canvasShowPage.vue'
  59. export default {
  60. components: {
  61. AdWindow,
  62. CategoryList,
  63. CategoryShow,
  64. canvasPage,
  65. tuiModal
  66. },
  67. data() {
  68. return {
  69. terminal: API.terminal,
  70. activeTab: 0,
  71. categoryid: 0,
  72. topHeight: 0,
  73. height: 0,
  74. topLeft: 0,
  75. privacyShow:false
  76. }
  77. },
  78. onLoad() {
  79. if (!uni.getStorageSync('storage_key')) {
  80. // #ifdef APP-PLUS
  81. this.privacyShow = true
  82. // #endif
  83. }
  84. },
  85. onShow() {
  86. // #ifdef MP-WEIXIN || MP-BAIDU || MP-TOUTIAO || MP-QQ
  87. let menuButtonInfo = uni.getMenuButtonBoundingClientRect()
  88. this.topHeight = menuButtonInfo.top + 10
  89. this.height = menuButtonInfo.height
  90. // #endif
  91. this.$nextTick(() => {
  92. this.$refs.adWindow.getAd()
  93. })
  94. },
  95. onPageScroll(e) {
  96. this.topLeft = e.scrollTop
  97. },
  98. methods: {
  99. tabChange(index, id) {
  100. this.activeTab = index
  101. this.categoryid = id
  102. },
  103. // 查询产品
  104. searchPro(key, type) {
  105. uni.navigateTo({
  106. url: `/pages_category_page1/search/index/index`
  107. })
  108. }
  109. }
  110. };
  111. </script>
  112. <style lang="scss" scoped>
  113. .header {
  114. .toLive {
  115. height: 40px;
  116. color: #FFF;
  117. background-color: #333;
  118. }
  119. .topBox {
  120. display: flex;
  121. align-items: center;
  122. justify-content: space-between;
  123. width: 100%;
  124. }
  125. .logo {
  126. width: 280rpx;
  127. height: 42rpx;
  128. margin-top: -40rpx;
  129. // margin-left: 30rpx;
  130. }
  131. .search-btn {
  132. height: 66rpx;
  133. background: rgba(255, 255, 255, 1);
  134. border-radius: 33rpx;
  135. display: flex;
  136. flex-direction: row;
  137. align-items: center;
  138. margin-right: 30rpx;
  139. .search-icon {
  140. width: 60rpx;
  141. height: 60rpx;
  142. // margin-left: 33rpx;
  143. }
  144. .search-word {
  145. font-size: 26rpx;
  146. font-weight: 400;
  147. color: rgba(153, 153, 153, 1);
  148. margin-left: 10rpx;
  149. }
  150. }
  151. .tabs-nav-warp {
  152. margin-top: 20rpx;
  153. padding: 0 30rpx;
  154. }
  155. .tabs-nav {
  156. .ul {
  157. display: flex;
  158. .li {
  159. flex: 1 0 auto;
  160. margin-left: 36rpx;
  161. font-size: 30rpx;
  162. color: #999999;
  163. position: relative;
  164. padding-bottom: 18rpx;
  165. &:first-child {
  166. margin-left: 0;
  167. }
  168. &.on {
  169. &:after {
  170. content: '';
  171. width: 100%;
  172. height: 4rpx;
  173. background: #C5AA7B;
  174. position: absolute;
  175. left: 0;
  176. bottom: 0;
  177. }
  178. font-weight:bold;
  179. }
  180. }
  181. }
  182. }
  183. }
  184. .weiXinBox {
  185. width: 100%;
  186. position: fixed;
  187. background: #FFFFFF;
  188. z-index: 99;
  189. }
  190. .wxBtnBg {
  191. padding: 0 20rpx;
  192. .weiXinBoxBtn {
  193. display: flex;
  194. align-items: center;
  195. padding: 10rpx 0 10rpx 15rpx;
  196. width: 100%;
  197. background: #F3F4F5;
  198. opacity: 1;
  199. .search-icon {
  200. width: 50rpx;
  201. height: 50rpx;
  202. margin-right: 20rpx;
  203. }
  204. text {
  205. color: #999999;
  206. }
  207. }
  208. }
  209. .terminal1 {
  210. .header {
  211. .topBox {
  212. // justify-content: left;
  213. .search-btn {
  214. .search-icon {
  215. margin-left: 0rpx;
  216. }
  217. }
  218. }
  219. }
  220. }
  221. .topTitle {
  222. display: flex;
  223. justify-content: center;
  224. align-items: center;
  225. height: 100rpx;
  226. width: 100%;
  227. .topText {
  228. text-align: center;
  229. color: #000000;
  230. font-size: 38rpx;
  231. font-weight: bold;
  232. }
  233. }
  234. .topWap {
  235. padding-top: 60rpx;
  236. .logo {
  237. margin-top: 0 !important;
  238. }
  239. }
  240. .terminal2 {}
  241. .terminal3 {}
  242. // 触底样式
  243. .reachBottom {
  244. margin-top: 30rpx;
  245. display: flex;
  246. flex-direction: column;
  247. align-items: center;
  248. .reach-icon {
  249. width: 150rpx;
  250. height: 150rpx;
  251. }
  252. .reach-text {
  253. margin: 20rpx 0;
  254. color: #CCCCCC;
  255. }
  256. }
  257. .Put-box1 {
  258. .btn {
  259. text-align: center;
  260. margin-top: 40rpx;
  261. border: 1px solid #333333;
  262. height: 80upx;
  263. line-height: 80upx;
  264. width: 100%;
  265. color: #333333;
  266. }
  267. .submit {
  268. background-color: #333333;
  269. color: #FFEBC4;
  270. }
  271. }
  272. </style>