index.vue 8.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411
  1. <template>
  2. <view class="container">
  3. <view class="status_bar"></view>
  4. <!-- 轮播图 start -->
  5. <swiper class="top-swiper" autoplay="true" duration="400" interval="5000" @change="swiperChange">
  6. <swiper-item v-for="(item, index) in carouselList" :key="index" class="carousel-item"
  7. @click="bannerNavToUrl(item)">
  8. <image :src="item.pic" />
  9. </swiper-item>
  10. </swiper>
  11. <!-- 轮播图 end -->
  12. <!-- 认证提示 statr-->
  13. <view class="rznow flex">
  14. <view class="rztit">
  15. 您尚未完成身份认证,前往认证>>
  16. </view>
  17. <view class="rzbtn">
  18. 立即认证
  19. </view>
  20. </view>
  21. <!-- 认证提示 ed-->
  22. <!-- 功能区 start-->
  23. <view class="gn-wrap flex">
  24. <view class="gn-icon flex">
  25. <image src="../../static/icon/in1.png" mode="heightFix"></image>
  26. </view>
  27. <view class="gn-tit">
  28. <view class="">
  29. 租电
  30. </view>
  31. <view class="tit-jj">
  32. 以租代购 方便省钱
  33. </view>
  34. </view>
  35. <view class="gn-btn">
  36. 立即租电
  37. </view>
  38. </view>
  39. <view class="gn-wrap flex">
  40. <view class="gn-icon flex">
  41. <image src="../../static/icon/in2.png" mode="heightFix"></image>
  42. </view>
  43. <view class="gn-tit">
  44. <view class="">
  45. 配件购买
  46. </view>
  47. <view class="tit-jj">
  48. 扫码租电
  49. </view>
  50. </view>
  51. <view class="gn-btn">
  52. 立即购买
  53. </view>
  54. </view>
  55. <!-- 功能区 ed-->
  56. <!-- 附近门店 start -->
  57. <view class="fjmd">
  58. <image src="../../static/img/md.png" mode=""></image>
  59. </view>
  60. <!-- 附近门店 end -->
  61. <!-- 使用攻略 start -->
  62. <view class="sygl">
  63. <view class="sy-top">
  64. <image src="../../static/icon/gl-top.png" mode=""></image>
  65. <view class="top-tit">
  66. 使用攻略
  67. </view>
  68. </view>
  69. <view class="sy-content flex">
  70. <view class="content-item flex">
  71. <image src="../../static/icon/sy1.png" mode="" class="sy-icon"></image>
  72. <view class="">
  73. 注册账号
  74. </view>
  75. </view>
  76. <image src="../../static/icon/jt.png" mode="" class="jt"></image>
  77. <view class="content-item flex">
  78. <image src="../../static/icon/sy2.png" mode="" class="sy-icon"></image>
  79. <view class="">
  80. 实名认证
  81. </view>
  82. </view>
  83. <image src="../../static/icon/jt.png" mode="" class="jt"></image>
  84. <view class="content-item flex">
  85. <image src="../../static/icon/sy3.png" mode="" class="sy-icon"></image>
  86. <view class="">
  87. 购买租电
  88. </view>
  89. </view>
  90. <image src="../../static/icon/jt.png" mode="" class="jt"></image>
  91. <view class="content-item flex">
  92. <image src="../../static/icon/sy4.png" mode="" class="sy-icon"></image>
  93. <view class="">
  94. 开始使用
  95. </view>
  96. </view>
  97. </view>
  98. </view>
  99. <!-- 使用攻略 ed-->
  100. </view>
  101. </template>
  102. <script>
  103. export default {
  104. data() {
  105. return {
  106. carouselList: [],//轮播图
  107. };
  108. },
  109. computed: {
  110. },
  111. // 切换或显示后变动tabbar颜色
  112. onHide() {
  113. },
  114. onLoad: function(option) {
  115. // #ifndef MP
  116. if (option.spread) {
  117. // 存储其他邀请人
  118. uni.setStorageSync('spread', option.spread);
  119. }
  120. // #endif
  121. // #ifdef MP
  122. if (option.scene) {
  123. // 存储小程序邀请人
  124. uni.setStorage({
  125. key: 'spread_code',
  126. data: option.scene
  127. });
  128. }
  129. // #endif
  130. },
  131. onShow() {
  132. },
  133. onReady() {
  134. },
  135. // #ifdef MP
  136. onShareAppMessage(options) {
  137. // 设置菜单中的转发按钮触发转发事件时的转发内容
  138. let pages = getCurrentPages(); //获取加载的页面
  139. let currentPage = pages[pages.length - 1]; //获取当前页面的对象
  140. let url = currentPage.route; //当前页面url
  141. let item = currentPage.options; //如果要获取url中所带的参数可以查看options
  142. let shareObj = {
  143. title: '租电', // 默认是小程序的名称(可以写slogan等)
  144. path: url, // 默认是当前页面,必须是以‘/’开头的完整路径
  145. imageUrl: '',
  146. desc:'',
  147. success: function(res) {
  148. // 转发成功之后的回调
  149. if (res.errMsg == 'shareAppMessage:ok') {}
  150. },
  151. fail: function() {
  152. // 转发失败之后的回调
  153. if (res.errMsg == 'shareAppMessage:fail cancel') {
  154. // 用户取消转发
  155. } else if (res.errMsg == 'shareAppMessage:fail') {
  156. // 转发失败,其中 detail message 为详细失败信息
  157. }
  158. }
  159. };
  160. // 判断是否可以邀请
  161. // if (this.userInfo.uid) {
  162. // shareObj.path += '&spread=' + this.userInfo.uid;
  163. // }
  164. return shareObj;
  165. },
  166. // #endif
  167. methods: {}
  168. };
  169. </script>
  170. <style lang="scss">
  171. page {
  172. background: #ffff;
  173. min-height: 100%;
  174. height: auto;
  175. }
  176. // 顶部搜索
  177. .top-search {
  178. height: 80rpx;
  179. padding: 0 20rpx;
  180. background-color: #fff;
  181. .top-logo {
  182. width: 50rpx;
  183. // height: 50rpx;
  184. margin-right: 10rpx;
  185. image {
  186. width: 48rpx;
  187. }
  188. }
  189. .search-box {
  190. justify-content: center;
  191. width: 698rpx;
  192. height: 60rpx;
  193. background: #EEEEEE;
  194. // box-shadow: 0px 10rpx 20rpx 0px rgba(4, 114, 69, 0.22);
  195. border-radius: 30rpx;
  196. .search {
  197. width: 34rpx;
  198. height: 34rpx;
  199. }
  200. .search-font {
  201. margin-left: 14rpx;
  202. font-size: 28rpx;
  203. font-family: PingFang SC;
  204. font-weight: 500;
  205. color: #CBCBCB;
  206. }
  207. }
  208. }
  209. // 顶部轮播图
  210. .top-swiper {
  211. width: 750rpx;
  212. height: 473rpx;
  213. // margin: 20rpx 0 0;
  214. image {
  215. width: 750rpx;
  216. height: 473rpx;
  217. }
  218. }
  219. .jg {
  220. height: 20rpx;
  221. background: #F8F8F8;
  222. }
  223. // 分类
  224. .cate-section {
  225. justify-content: space-around;
  226. background-color: #fff;
  227. padding: 0rpx 0 30rpx;
  228. .cate-item {
  229. flex-grow: 0;
  230. width: 20%;
  231. flex-direction: column;
  232. text-align: center;
  233. align-items: center;
  234. justify-content: center;
  235. .img-wrapper {
  236. width: 112rpx;
  237. height: 112rpx;
  238. border-radius: 20rpx;
  239. position: relative;
  240. image {
  241. width: 112rpx;
  242. height: 112rpx;
  243. position: absolute;
  244. left: 50%;
  245. top: 50%;
  246. transform: translate(-50%, -50%);
  247. }
  248. }
  249. .item-title {
  250. margin-top: 15rpx;
  251. font-size: 26rpx;
  252. font-weight: 500;
  253. color: #666666;
  254. }
  255. }
  256. }
  257. .rznow {
  258. font-weight: 500;
  259. font-size: 26rpx;
  260. color: #FFFFFF;
  261. background-color: #78797a;
  262. height: 74rpx;
  263. padding: 0 42rpx 0 52rpx;
  264. .rztit {
  265. line-height: 74rpx;
  266. }
  267. .rzbtn {
  268. width: 127rpx;
  269. height: 47rpx;
  270. text-align: center;
  271. line-height: 47rpx;
  272. background: #35d9b7;
  273. border-radius: 24rpx;
  274. font-size: 22rpx;
  275. }
  276. }
  277. .gn-wrap {
  278. margin: 45rpx auto;
  279. width: 670rpx;
  280. height: 219rpx;
  281. background: #FFFFFF;
  282. box-shadow: 0rpx 0rpx 20rpx 0rpx rgba(50,50,52,0.06);
  283. border-radius: 30rpx;
  284. padding-right: 47rpx;
  285. .gn-icon {
  286. flex-shrink: 0;
  287. width: 210rpx;
  288. height: 100%;
  289. justify-content: center;
  290. image {
  291. height: 112rpx;
  292. }
  293. }
  294. .gn-tit {
  295. flex-grow: 1;
  296. font-weight: bold;
  297. color: #333333;
  298. font-size: 36rpx;
  299. flex-direction: column;
  300. justify-content: center;
  301. align-items: flex-start;
  302. .tit-jj {
  303. font-size: 25rpx;
  304. font-weight: 500;
  305. color: #666666;
  306. padding-top: 32rpx;
  307. }
  308. }
  309. .gn-btn {
  310. flex-shrink: 0;
  311. width: 127rpx;
  312. border: 1px solid $base-color;
  313. border-radius: 28rpx;
  314. font-size: 25rpx;
  315. font-weight: 500;
  316. color: $base-color;
  317. line-height: 55rpx;
  318. text-align: center;
  319. }
  320. }
  321. .fjmd {
  322. width: 708rpx;
  323. height: 288rpx;
  324. margin: 20rpx auto;
  325. image {
  326. width: 100%;
  327. height: 100%;
  328. }
  329. }
  330. .sygl {
  331. .sy-top {
  332. position: relative;
  333. height: 100rpx;
  334. image {
  335. width: 369rpx;
  336. height: 8rpx;
  337. position: absolute;
  338. top: 0;
  339. bottom: 0;
  340. left: 0;
  341. right: 0;
  342. margin: auto;
  343. }
  344. .top-tit {
  345. font-size: 32rpx;
  346. font-weight: bold;
  347. color: #4A2723;
  348. text-align: center;
  349. line-height: 100rpx;
  350. }
  351. }
  352. .sy-content {
  353. padding: 0 10rpx 65rpx ;
  354. .content-item {
  355. flex-grow: 1;
  356. flex-direction: column;
  357. justify-content: center;
  358. align-items: center;
  359. font-size: 22rpx;
  360. font-weight: 500;
  361. color: #4A2723;
  362. }
  363. .sy-icon {
  364. width: 90rpx;
  365. height: 90rpx;
  366. margin-bottom: 15rpx;
  367. }
  368. .jt {
  369. flex-shrink: 0;
  370. width: 14rpx;
  371. height: 15rpx;
  372. margin-top: 40rpx;
  373. align-self: flex-start;
  374. }
  375. }
  376. }
  377. </style>