shoplist.vue 7.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288
  1. <template>
  2. <view>
  3. <u-tabs lineColor="rgba(0,0,0,0)" :activeStyle="{
  4. color: 'rgba(255, 21, 21, 1)',
  5. fontWeight: 'bold',
  6. transform: 'scale(1.05)'
  7. }" :list="list1" @click="click"></u-tabs>
  8. <view class="box" style="position: relative;">
  9. <view class="u-flex u-row-between">
  10. <view @click="current=0" class="u-flex" :style="{color:current==0?'rgba(255, 21, 21, 1)':''}">
  11. {{i18n.synthesis}}
  12. <view>
  13. </view>
  14. <u-icon name="arrow-down-fill" color="rgba(255, 21, 21, 1)" size="8"></u-icon>
  15. </view>
  16. <text @click="current=1" :style="{color:current==1?'rgba(255, 21, 21, 1)':''}">{{i18n.sell}}</text>
  17. <view @click="current=2" class=" u-flex" :style="{color:current==2?'rgba(255, 21, 21, 1)':''}">
  18. <view>{{i18n.Pricea}}</view>
  19. <image src="static/images/up.png" style="width: 16rpx;height: 16rpx;" mode=""></image>
  20. </view>
  21. <text @click="current=3" :style="{color:current==3?'rgba(255, 21, 21, 1)':''}">≤1kg</text>
  22. <text>|</text>
  23. <view class="u-flex" :style="{color:current==4?'rgba(255, 21, 21, 1)':''}" @click="shaixuan">
  24. <view style="margin-right: 10rpx;">{{i18n.screen}}</view>
  25. <image v-if="current==4" src="static/images/shaixuana.png" style="width: 24rpx;height: 24rpx;"
  26. mode=""></image>
  27. <image v-else src="static/images/shaixuan.png" style="width: 24rpx;height: 24rpx;" mode=""></image>
  28. </view>
  29. </view>
  30. <liu-waterfall :dataList="data" :column="columns" @click="detail"></liu-waterfall>
  31. <view class="pop" style="position: absolute;top:80rpx" v-if="shai&&current==4">
  32. <view class=" title">{{i18n.Pricerange}}</view>
  33. <view class="u-flex u-row-between">
  34. <view class="input u-flex u-row-center">
  35. <input style="text-align: center;" type="text" :placeholder="i18n.Bottomprice" />
  36. </view>
  37. <text>-</text>
  38. <view class="input u-flex u-row-center">
  39. <input style="text-align: center;" type="text" :placeholder="i18n.highestprice" />
  40. </view>
  41. </view>
  42. <view class="title" style="margin-top: 36rpx;">{{i18n.Weightinterval}}</view>
  43. <view class="u-flex u-row-between">
  44. <view class="input u-flex u-row-center">
  45. <input style="text-align: center;" type="text" :placeholder="i18n.Bottomprice" />
  46. </view>
  47. <text>-</text>
  48. <view class="input u-flex u-row-center">
  49. <input style="text-align: center;" type="text" :placeholder="i18n.highestprice" />
  50. </view>
  51. </view>
  52. <view style="margin-top: 36rpx;" class="title">{{i18n.brand}}</view>
  53. <view class="u-flex " style="flex-wrap: wrap;column-gap: 34rpx;">
  54. <view @click="changei(idx)" class="item" v-for="(item,idx) in 8" :key="idx"
  55. :class="index==idx?'acitem':'item'">
  56. PURICH/醇粹
  57. </view>
  58. </view>
  59. <view style="margin-top: 36rpx;" class="title">{{i18n.Proprietary}}</view>
  60. <view class="item">
  61. {{i18n.yes}}
  62. </view>
  63. <view class="bottom u-flex" style="margin-top: 58rpx;">
  64. <view class="btn1">
  65. {{i18n.reset}}
  66. </view>
  67. <view class="btn2" @click="shai=false">
  68. {{i18n.enter}}
  69. </view>
  70. </view>
  71. </view>
  72. </view>
  73. </view>
  74. </template>
  75. <script>
  76. export default {
  77. data() {
  78. return {
  79. shai: false,
  80. current: 0,
  81. curess: 0,
  82. index: '',
  83. list1: [],
  84. data: [],
  85. columns: 2,
  86. goodsid: '',
  87. title: '',
  88. parent_id: '',
  89. language:'',
  90. page:1,
  91. };
  92. },
  93. onLoad(options) {
  94. console.log(options);
  95. this.goodsid = options.id
  96. this.title = options.title
  97. this.parent_id = options.parent_id
  98. },
  99. onShow() {
  100. uni.setNavigationBarTitle({
  101. title: this.title
  102. })
  103. this.goods(this.goodsid)
  104. this.category(this.parent_id)
  105. if (uni.getStorageSync('language') != '') {
  106. this.language = uni.getStorageSync('language')
  107. }
  108. },
  109. computed: {
  110. i18n() {
  111. return this.$t('index')
  112. }
  113. },
  114. methods: {
  115. //商品详情
  116. detail(item){
  117. console.log(item);
  118. uni.navigateTo({
  119. url:'/pageA/productdetails?id='+item.id
  120. })
  121. },
  122. //商品分类
  123. category(id) {
  124. uni.$u.http.get('/api/goods/category', {
  125. params: {
  126. parent_id: id,
  127. limit:10,
  128. page:this.page
  129. }
  130. }).then((res) => {
  131. const categoryArr = res
  132. if (this.language == 'en-US') {
  133. categoryArr.forEach(item => {
  134. item.name = item.name_en
  135. })
  136. }
  137. if (this.language == 'es-ES') {
  138. categoryArr.forEach(item => {
  139. item.name = item.name_es
  140. })
  141. }
  142. if (this.language == 'it-IT') {
  143. categoryArr.forEach(item => {
  144. item.name = item.name_ita
  145. })
  146. }
  147. if (this.language == 'zh-CN') {
  148. categoryArr.forEach(item => {
  149. item.name = item.name_cn
  150. })
  151. }
  152. this.list1 = categoryArr
  153. }).catch(() => {
  154. })
  155. },
  156. //商品列表
  157. goods(id) {
  158. uni.$u.http.get('/api/goods', {
  159. params: {
  160. category_id: id
  161. }
  162. }).then((res) => {
  163. this.data = res.data
  164. }).catch(() => {
  165. })
  166. },
  167. shaixuan() {
  168. this.shai = true,
  169. this.current = 4
  170. },
  171. click(item) {
  172. console.log('item', item);
  173. this.curess = item.index
  174. this.goods(item.id)
  175. // uni.navigateTo({
  176. // url: '/pageB/delivery'
  177. // })
  178. },
  179. changei(idx) {
  180. this.index = idx
  181. }
  182. }
  183. }
  184. </script>
  185. <style lang="scss" scoped>
  186. .box {
  187. width: 750rpx;
  188. min-height: 1360rpx;
  189. background: #FFFFFF;
  190. border-radius: 28rpx 28rpx 0rpx 0rpx;
  191. padding: 38rpx 20rpx 20rpx;
  192. box-sizing: border-box;
  193. margin-top: 20rpx;
  194. }
  195. .pop {
  196. width: 750rpx;
  197. // height: 904rpx;
  198. background: #FFFFFF;
  199. padding: 36rpx 32rpx;
  200. box-sizing: border-box;
  201. .btn1 {
  202. width: 702rpx;
  203. height: 84rpx;
  204. background: rgba(248, 50, 36, 0.1);
  205. border-radius: 42rpx;
  206. font-family: PingFangSC, PingFang SC;
  207. font-weight: 500;
  208. font-size: 32rpx;
  209. color: #F83224;
  210. line-height: 84rpx;
  211. text-align: center;
  212. font-style: normal;
  213. border-radius: 42rpx 0 0 42rpx;
  214. }
  215. .btn2 {
  216. width: 702rpx;
  217. height: 84rpx;
  218. background: #F83224;
  219. border-radius: 42rpx;
  220. font-family: PingFangSC, PingFang SC;
  221. font-weight: 500;
  222. font-size: 32rpx;
  223. color: #FFFFFF;
  224. line-height: 84rpx;
  225. text-align: center;
  226. font-style: normal;
  227. border-radius: 0rpx 42rpx 42rpx 0;
  228. }
  229. .item {
  230. width: 206rpx;
  231. height: 64rpx;
  232. background: #F4F4F4;
  233. border-radius: 36rpx;
  234. font-family: PingFangSC, PingFang SC;
  235. font-weight: 400;
  236. font-size: 24rpx;
  237. color: #131415;
  238. line-height: 64rpx;
  239. text-align: center;
  240. font-style: normal;
  241. margin-top: 26rpx;
  242. }
  243. .acitem {
  244. width: 206rpx;
  245. height: 64rpx;
  246. font-family: PingFangSC, PingFang SC;
  247. font-weight: 400;
  248. font-size: 24rpx;
  249. color: rgba(248, 50, 36, 1);
  250. line-height: 64rpx;
  251. text-align: center;
  252. font-style: normal;
  253. margin-top: 26rpx;
  254. background: rgba(248, 50, 36, 0.1);
  255. border: 1rpx solid #F83224;
  256. box-sizing: border-box;
  257. }
  258. .title {
  259. font-family: PingFangSC, PingFang SC;
  260. font-weight: 500;
  261. font-size: 26rpx;
  262. color: #131415;
  263. line-height: 36rpx;
  264. text-align: left;
  265. font-style: normal;
  266. margin-bottom: 24rpx;
  267. }
  268. .input {
  269. width: 312rpx;
  270. height: 64rpx;
  271. background: #F4F4F4;
  272. border-radius: 36rpx;
  273. }
  274. }
  275. </style>