shop.vue 7.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289
  1. <template name="res">
  2. <mescroll-uni :down="mescroll" @down="down" @up="up">
  3. <view class="fixed">
  4. <cu-custom bgColor="bg-shadeTop text-white">
  5. <block slot="content">发现</block>
  6. </cu-custom>
  7. </view>
  8. <view class="cu-bar bg-white solid-bottom margin-top hide">
  9. <view class="action">
  10. <text class="cuIcon-title text-orange "></text> 最新动态
  11. </view>
  12. </view>
  13. <!--背景效果-->
  14. <image src="https://yhtx.itianc.com/wxxcx/57b6c21fa7290.jpg" mode="aspectFill" class="canui-head-vague"></image>
  15. <view class="canui-head-gradient"></view>
  16. <!--标题栏区域-->
  17. <view class="canui-head-custom">
  18. <view class='canui-shop-title' bindtap='btnback'>
  19. <text class="icon-back"></text> <text>XXXX旗舰店</text>
  20. </view>
  21. <view class="canui-shop-synopsis text-sm">
  22. <text class="canui-xzwz">店铺简介店铺简介店铺简介店铺简介店铺简介店铺简介店铺简介店铺简介店铺简介店铺简介店铺简介店铺简介</text>
  23. </view>
  24. </view>
  25. <!--搜索框-->
  26. <view class="cu-bar search">
  27. <view class='search-form round'>
  28. <text class="icon-search"></text>
  29. <input type="text" placeholder="搜索店铺内的商品" confirm-type="search" placeholder-class="canui-input-placeholder"></input>
  30. </view>
  31. <view class='action'>
  32. <button class='cu-btn shadow-blur round canui-btn-wxjn' bindtap="search">搜索</button>
  33. </view>
  34. </view>
  35. <!--菜单导航栏-->
  36. <scroll-view scroll-x class="nav text-left canui-shop-table">
  37. <view v-for="(item,index) in SortMenu" :key="index" class="cu-item" :class="item.id==TabCur?'cur':''" bindtap='tabSelect' :data-id="item.id">
  38. {{item.name}}
  39. </view>
  40. </scroll-view>
  41. <!--商品列表-->
  42. <view class='nav-list canui-shop-goods-list'>
  43. <navigator v-for="(item,index) in ShopList" :key="index" class="nav-li" open-type="navigate" hover-class='none'>
  44. <image :src="item.image" mode="aspectFill"></image>
  45. <view class="nav-li-box">
  46. <view class="nav-title canui-xzwz text-sm">{{item.title}}</view>
  47. <view class="shop-zx">
  48. <text class="text-price text-red text-xs">{{item.price}} </text>
  49. <text class="text-gray text-sm">{{item.sales}}人已兑换</text>
  50. </view>
  51. </view>
  52. </navigator>
  53. </view>
  54. <view class='cu-tabbar-height'></view>
  55. </mescroll-uni>
  56. </template>
  57. <script>
  58. export default {
  59. name: "res",
  60. data() {
  61. return {
  62. mescroll: {
  63. auto: false //是否在初始化后,自动执行下拉回调callback; 默认true
  64. },
  65. TabCur: 0,
  66. scrollLeft:0,
  67. SortMenu: [{id:0,name:"综合"},{id:1,name:"销量"},{id:2,name:"新品"},{id:3,name:"价格"}],
  68. ShopList: [{
  69. index: 1,
  70. image: 'https://image.weilanwl.com/img/4x3-1.jpg',
  71. title: '商品名称商品名称商品名称商品名称',
  72. price: '100',
  73. sales: '2.2万'
  74. },{
  75. index: 2,
  76. image: 'https://image.weilanwl.com/img/4x3-2.jpg',
  77. title: '商品名称商品名称',
  78. price: '1000',
  79. sales: '85'
  80. },{
  81. index: 3,
  82. image: 'https://image.weilanwl.com/img/4x3-3.jpg',
  83. title: '商品名称商品名称商品名称商品名称',
  84. price: '39.9',
  85. sales: '2000'
  86. },{
  87. index: 4,
  88. image: 'https://image.weilanwl.com/img/4x3-4.jpg',
  89. title: '商品名称商品名称商品名称商品名称',
  90. price: '100',
  91. sales: '2.2万'
  92. },{
  93. index: 5,
  94. image: 'https://image.weilanwl.com/img/4x3-3.jpg',
  95. title: '商品名称商品名称商品名称商品名称',
  96. price: '39.9',
  97. sales: '2000'
  98. },{
  99. index: 6,
  100. image: 'https://image.weilanwl.com/img/4x3-4.jpg',
  101. title: '商品名称商品名称商品名称商品名称',
  102. price: '100',
  103. sales: '2.2万'
  104. }],
  105. };
  106. },
  107. mounted: function(option) {
  108. },
  109. methods: {
  110. /*下拉刷新的回调 */
  111. down(option) {
  112. //联网加载数据
  113. console.info(2222);
  114. },
  115. /*上拉加载的回调: option携带page的参数, 其中num:当前页 从1开始, size:每页数据条数,默认10 */
  116. up(option) {
  117. //联网加载数据
  118. console.info(3333);
  119. },
  120. }
  121. }
  122. </script>
  123. <style>
  124. .canui-head-gradient{
  125. position: absolute;
  126. background-image:linear-gradient(rgba(255, 255, 255, 0.01), rgba(241, 241, 241, 1));
  127. width: 100%;
  128. height: 600rpx;
  129. top: 0;
  130. }
  131. /*-------标题栏-------*/
  132. .canui-head-custom{
  133. position: relative;
  134. width: 100%;
  135. top: 0;
  136. height:100rpx;
  137. }
  138. .canui-shop-title{
  139. display:flex;
  140. align-items:left;
  141. justify-content:left;
  142. max-width:100%;
  143. padding:10rpx;
  144. padding-right:320rpx;
  145. }
  146. .canui-shop-title:first-child{
  147. margin-left:20rpx;
  148. font-size:33rpx;
  149. }
  150. .canui-shop-title:last-child{
  151. margin-right:30rpx;
  152. }
  153. .canui-shop-title:first-child>text[class*="icon"] {
  154. margin-left:-0.3em;
  155. margin-right:0.3em;
  156. margin-top:3rpx;
  157. }
  158. .canui-shop-title > text[class*="icon"], .canui-shop-title > view[class*="icon"] {
  159. font-size:36rpx;
  160. }
  161. .canui-shop-synopsis{
  162. padding:0 30rpx;
  163. }
  164. /*-------关注按钮-------*/
  165. .canui-head-box{
  166. position:absolute;
  167. top:26px;
  168. right:192rpx;
  169. background:rgba(0,0,0,0.2);
  170. border-radius:20px;
  171. padding:4.5px 10px;
  172. border:1px solid rgba(255,255,255,0.3);
  173. font-size:28rpx;
  174. }
  175. .canui-head-box text{
  176. font-size:15px;
  177. margin-right:3rpx;
  178. }
  179. /*-------搜索框区域-------*/
  180. .cu-bar{
  181. padding-top:15rpx;
  182. }
  183. .cu-bar .search-form{
  184. background:rgba(241,241,241,0.3);
  185. }
  186. .cu-bar .search-form [class*="icon"]{
  187. margin:0 0.5em 0 0.4em;
  188. font-size:38rpx;
  189. }
  190. .cu-bar .search-form input{
  191. font-size:26rpx;
  192. }
  193. .canui-input-placeholder{
  194. }
  195. .canui-btn-wxjn{
  196. }
  197. .canui-btn-wxjn:not([class*="bg-"]) {
  198. background:rgba(241,241,241,0.3);
  199. }
  200. /*-------菜单导航栏-------*/
  201. .canui-shop-table{
  202. padding:15rpx 15rpx;
  203. }
  204. .nav .cu-item {
  205. height:60rpx;
  206. line-height:60rpx;
  207. margin:0 10rpx;
  208. padding:0 30rpx;
  209. color: #f1f1f1;
  210. }
  211. .nav .cu-item.cur{
  212. border-bottom:0;
  213. background:rgba(241,241,241,0.3);
  214. border-radius:55px;
  215. color: rgba(254,0,0,0.8);
  216. }
  217. /*-------商品列表-------*/
  218. .canui-shop-goods-list{
  219. padding:10rpx 20rpx 0px;
  220. }
  221. .canui-shop-goods-list .nav-li{
  222. background-image:initial;
  223. background-size:initial;
  224. background-position:initial;
  225. background:initial;
  226. padding:0;
  227. width:345rpx;
  228. margin:0 5rpx 20rpx;
  229. border-radius:0;
  230. }
  231. .canui-shop-goods-list .nav-li image{
  232. width:100%;
  233. height:345rpx;
  234. z-index:99999;
  235. border-radius:15rpx 15rpx 0 0;
  236. }
  237. .canui-shop-goods-list .nav-li .nav-li-box{
  238. position: relative;
  239. background: #Ffff;
  240. padding: 10rpx 20rpx;
  241. border-radius: 0 0 15rpx 15rpx;
  242. box-shadow: 0 0 10rpx rgba(0, 0, 0, 0.1);
  243. top: -6rpx;
  244. z-index: 0;
  245. }
  246. .canui-shop-goods-list .nav-li .nav-li-box .nav-title {
  247. font-size: 28 rpx;
  248. }
  249. .canui-shop-goods-list .nav-li text{
  250. position: relative;
  251. right:initial;
  252. top:initial;
  253. font-size:inherit;
  254. width:inherit;
  255. height:initial;
  256. text-align:initial;
  257. line-height:inherit;
  258. }
  259. .canui-shop-goods-list .nav-li .shop-zx{
  260. position: relative;
  261. padding:10rpx 0;
  262. }
  263. .canui-shop-goods-list .nav-li .shop-zx .text-sm{
  264. font-size:20rpx;
  265. }
  266. .canui-shop-goods-list .nav-li .shop-zx .text-price{
  267. font-size:30rpx;
  268. margin-right:8rpx;
  269. }
  270. </style>