result.vue 5.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244
  1. <template>
  2. <view class="result">
  3. <view class="top">
  4. <navbar :config="config">
  5. <view slot="right" style="font-size: 36rpx; font-weight: 500; color: #FFFFFF;margin-right: 30rpx;">
  6. 搜索
  7. </view>
  8. </navbar>
  9. </view>
  10. <view class="list">
  11. <view class="item" @click="changeColor(1)" >
  12. <view class="item-top" :class="colorIndex==1?'item-active':''">
  13. 综合
  14. </view>
  15. <view class="item-bottom" >
  16. <view class="iconfont u-font24 linge" >&#xeb20;</view>
  17. <view class="iconfont u-font24 linge" >&#xeb1f;</view>
  18. </view>
  19. </view>
  20. <view class="item" @click="changeColor(2)" :class="colorIndex==2?'item-active':''">
  21. <view class="item-top">
  22. 销量
  23. </view>
  24. <view class="item-bottom">
  25. <view class="iconfont u-font24 linge top" >&#xeb20;</view>
  26. <view class="iconfont u-font24 linge" >&#xeb1f;</view>
  27. </view>
  28. </view>
  29. <view class="item" @click="changeColor(3)" :class="colorIndex==3?'item-active':''">
  30. <view class="item-top">
  31. 价格
  32. </view>
  33. <view class="item-bottom">
  34. <view class="iconfont u-font24 linge top" >&#xeb20;</view>
  35. <view class="iconfont u-font24 linge" >&#xeb1f;</view>
  36. </view>
  37. </view>
  38. <view class="item" @click="changeColor(4)" :class="colorIndex==4?'item-active':''">
  39. <view class="item-top">
  40. 销量
  41. </view>
  42. <view class="item-bottom">
  43. <view class="iconfont u-font24 linge top">&#xeb20;</view>
  44. <view class="iconfont u-font24 linge" >&#xeb1f;</view>
  45. </view>
  46. </view>
  47. </view>
  48. <view class="content">
  49. <view class="content-item" v-for="(item,index) in 4" :key="index">
  50. <view class="content-image">
  51. <image :src="imgUrl+'/cosmetics.png'" mode=""></image>
  52. </view>
  53. <view class="content-right">
  54. <view class="top">
  55. <image :src="imgUrl+'/logoOne.png'" mode=""></image>
  56. <text>雅诗兰黛(Estee Lauder)特润修护肌透精华露</text>
  57. </view>
  58. <view class="number">
  59. <view class="number-red">
  60. <view class="large">
  61. <text>¥</text>
  62. 64.
  63. </view>
  64. <view class="small">
  65. 20
  66. </view>
  67. </view>
  68. <view class="before">
  69. ¥64.00
  70. </view>
  71. </view>
  72. <view class="comment">
  73. <text>302</text>条评价<text>99%</text>好评
  74. </view>
  75. <view class="storefront">
  76. 金字火腿旗舰店 >
  77. </view>
  78. </view>
  79. </view>
  80. </view>
  81. </view>
  82. </template>
  83. <script>
  84. export default {
  85. data() {
  86. return {
  87. config: {
  88. back: true, //false是tolbar页面 是则不写
  89. title: '店铺',
  90. color: '#FFFFFF',
  91. //背景颜色;参数一:透明度(0-1);参数二:背景颜色(array则为线性渐变,string为单色背景)
  92. backgroundColor: [1, "#0B844A"],
  93. statusBarFontColor: '#FFFFFF',
  94. rightSlot: true,
  95. search: {
  96. value: '',
  97. placeholder: '请输入搜索关键字',
  98. disabled: false,
  99. },
  100. },
  101. colorIndex:1,
  102. flag:false,
  103. params:{
  104. limit:10,
  105. page:1,
  106. order_type:1,//1是综合(按发布时间),2是新品,3价格,4销量
  107. order_mode:''//asc 或 desc
  108. },
  109. imgUrl: this.$mConfig.staticUrl
  110. }
  111. },
  112. methods:{
  113. changeColor(e){
  114. this.colorIndex=e
  115. this.params.order_type =e
  116. if(e==1){
  117. this.flag=!this.flag
  118. if(this.price){
  119. this.params.order_mode='asc'
  120. }else{
  121. this.params.order_mode='desc'
  122. }
  123. }
  124. console.log(e)
  125. }
  126. }
  127. }
  128. </script>
  129. <style lang="scss" scoped>
  130. .content{
  131. background-color: #f5f5f5;
  132. padding: 30rpx;
  133. .content-item{
  134. margin-bottom: 26rpx;
  135. padding: 42rpx 22rpx;
  136. border-radius: 6rpx;
  137. background-color: #ffffff;
  138. display: flex;
  139. .content-image{
  140. image{
  141. width: 226rpx;
  142. height: 226rpx;
  143. border-radius: 10rpx;
  144. }
  145. }
  146. .content-right{
  147. margin-left: 20rpx;
  148. .storefront{
  149. color: #999999;
  150. font-size: 24rpx;
  151. font-weight: Medium;
  152. line-height: 24rpx;
  153. margin-top: 6rpx;
  154. }
  155. .comment{
  156. font-size: 20rpx;
  157. color: #999999;
  158. line-height: 24rpx;
  159. font-weight: Regular;
  160. margin-top: 30rpx;
  161. text{
  162. color: #FF4E15;
  163. }
  164. }
  165. .number{
  166. display: flex;
  167. margin-top: 20rpx;
  168. .before{
  169. margin-left: 20rpx;
  170. font-size: 22rpx;
  171. font-weight: 500;
  172. color: #CCCCCC;
  173. text-decoration: line-through;
  174. }
  175. .number-red{
  176. color: #FF0000;
  177. display: flex;
  178. .large{
  179. font-size: 32rpx;
  180. font-weight: 700;
  181. line-height: 24rpx;
  182. }
  183. .small{
  184. font-size: 20rpx;
  185. font-weight: Bold;
  186. line-height: 24rpx;
  187. }
  188. }
  189. }
  190. .top{
  191. text{
  192. line-height: 36rpx;
  193. font-size: 28rpx;
  194. font-weight: 400;
  195. color: #181818;
  196. margin-left: 20rpx;
  197. }
  198. image{
  199. font-size: 28rpx;
  200. font-weight: 400;
  201. line-height: 36rpx;
  202. color: red;
  203. width: 102rpx;
  204. height: 30rpx;
  205. }
  206. font-size: 28rpx;
  207. font-weight: 400;
  208. color: #181818;
  209. line-height: 36rpx;
  210. }
  211. }
  212. }
  213. }
  214. .list {
  215. display: flex;
  216. justify-content: space-around;
  217. color: #FFFFFF;
  218. font-weight: 700;
  219. line-height: 24rpx;
  220. font-size: 28rpx;
  221. padding: 42rpx 0 24rpx 0;
  222. background-color: #0B844A;
  223. .item{
  224. display: flex;
  225. .linge{
  226. line-height: 12rpx;
  227. }
  228. }
  229. .item-active{
  230. color: #DCCDA4;
  231. }
  232. }
  233. </style>