index.vue 12 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456
  1. <template>
  2. <!-- 商城 -->
  3. <view class="">
  4. <!-- <view class="index-navbar"> -->
  5. <view style="position: relative;">
  6. <!-- 自定义导航栏 -->
  7. <image src="../../static/images/index/back.png"
  8. style="width: 750rpx;height: 1200rpx;position: absolute;top: 0;z-index: -1;" mode=""></image>
  9. <u-navbar bgColor='rgba(255, 215,215, 1)' :placeholder='true' :fixed='true'>
  10. <view class="u-nav-slot" slot="left" style="display: flex;">
  11. <image @click="tochat" src="../../static/images/index/xiaoxi.png" mode=""
  12. style="width: 40rpx;height: 40rpx;">
  13. </image>
  14. <image @click="counter" src="../../static/images/index/compile.png" mode=""
  15. style="width: 40rpx;height: 40rpx;margin-left: 22rpx;"></image>
  16. <image src="../../static/images/index/dianhua.png" mode=""
  17. style="width: 40rpx;height: 40rpx;margin-left: 22rpx;"></image>
  18. </view>
  19. <view class="u-nav-slot" slot="center" style="width: 226rpx;">
  20. <u-subsection bgColor='rgba(248, 50, 36, 0.1)' activeColor='#F83224' inactiveColor='#222'
  21. :list="list" :current="current" @change="sectionChange"></u-subsection>
  22. </view>
  23. </u-navbar>
  24. <view class="" style="margin-top: 30rpx;padding:0 24rpx;">
  25. <!-- 搜索 -->
  26. <view class="search">
  27. <view class="u-flex">
  28. <u-icon name="search" size='32'></u-icon>
  29. <input type="text" :placeholder="i18n.Searchcon" />
  30. </view>
  31. <view class="right">
  32. {{i18n.search}}
  33. </view>
  34. </view>
  35. <!-- tabs -->
  36. <view class=""
  37. style="display: flex;margin-top: 20rpx;align-items: center;justify-content: space-between;">
  38. <u-tabs :list="list1"></u-tabs>
  39. <view class="border">
  40. </view>
  41. <view class="u-flex" style="margin-left: 24rpx;width: 100rpx;" @click="shoptype">
  42. <image src="../../static/images/index/fenlei.png" style="width: 24rpx;height: 24rpx;;" mode="">
  43. </image>
  44. <text class="fenlei">{{i18n.sort}}</text>
  45. </view>
  46. </view>
  47. <!-- 轮播图 -->
  48. <view class="" style="margin-top: 20rpx;">
  49. <u-swiper radius='10' :indicator='true' :list="banner"></u-swiper>
  50. </view>
  51. </view>
  52. </view>
  53. <!-- </view> -->
  54. <view class="shopback">
  55. <view class="u-flex u-row-between">
  56. <view class="bigbox">
  57. <view class="u-flex">
  58. <image src="../../static/images/index/butie.png" style="width: 104rpx;height: 26rpx;" mode="">
  59. </image>
  60. <view class="biaoqian" style="background: #F35D22;">{{i18n.expensive}}</view>
  61. </view>
  62. <view class="u-flex" style="flex-wrap: wrap;justify-content: space-between;">
  63. <view v-for="(item,idx) in 4" class="ssbox " style="margin-top: 16rpx;">
  64. <view class="" style="position: relative">
  65. <image src=""
  66. style="background-color: rgba(119, 119, 119, 1);width: 144rpx;height: 144rpx;"
  67. mode=""></image>
  68. <view class="u-flex u-row-center"
  69. style="position: absolute;bottom: 10rpx;width: 144rpx;">
  70. <view class="u-flex">
  71. <view class="tag u-flex" style="background: rgba(243, 93, 34, 1);">
  72. <image src="../../static/images/index/down.png"
  73. style="width: 28rpx;height: 28rpx;position: relative;z-index: 3;"
  74. mode="">
  75. </image>
  76. <text>{{15 + i18n.RMB}}</text>
  77. </view>
  78. </view>
  79. </view>
  80. </view>
  81. <view class="money" style="text-align: center;">
  82. ¥59
  83. </view>
  84. </view>
  85. </view>
  86. </view>
  87. <view class="">
  88. <view class="smallbox">
  89. <view class="u-flex">
  90. <image src="../../static/images/index/pinbao.png" style="width: 164rpx;height: 26rpx;"
  91. mode=""></image>
  92. <view class="biaoqian" style="background: rgba(255, 148, 21, 1);">{{i18n.expensive}}
  93. </view>
  94. </view>
  95. <view class="u-flex" style="flex-wrap: wrap;justify-content: space-between;">
  96. <view v-for="(item,idx) in 2" class="ssbox " style="margin-top: 16rpx;">
  97. <view class="" style="position: relative">
  98. <image src=""
  99. style="background-color: rgba(119, 119, 119, 1);width: 144rpx;height: 144rpx;"
  100. mode=""></image>
  101. <view class="u-flex u-row-center"
  102. style="position: absolute;bottom: 10rpx;width: 144rpx;">
  103. <view class="u-flex">
  104. <!-- <image src="../../static/images/index/label.png"
  105. style="width: 28rpx;height: 28rpx;position: relative;z-index: 3;"
  106. mode="">
  107. </image> -->
  108. <view class="tag u-flex" style="background-color: rgba(251, 73, 70, 1);">
  109. <image src="../../static/images/index/down.png"
  110. style="width: 28rpx;height: 28rpx;position: relative;z-index: 3;"
  111. mode="">
  112. </image>
  113. <text>{{15 + i18n.RMB}}</text>
  114. </view>
  115. </view>
  116. </view>
  117. </view>
  118. </view>
  119. </view>
  120. </view>
  121. <view class="smallbox">
  122. <view class="u-flex">
  123. <image src="../../static/images/index/postage.png" style="width: 116rpx;height: 26rpx;"
  124. mode=""></image>
  125. <view class="biaoqian" style="background:rgba(248, 50, 36, 1)">{{i18n.Something}}</view>
  126. </view>
  127. <view class="u-flex" style="flex-wrap: wrap;justify-content: space-between;">
  128. <view v-for="(item,idx) in 2" class="ssbox " style="margin-top: 8rpx;">
  129. <view class="" style="position: relative">
  130. <image src=""
  131. style="background-color: rgba(119, 119, 119, 1);width: 124rpx;height: 124rpx;"
  132. mode=""></image>
  133. <view class="shopname">
  134. 纯牛奶
  135. </view>
  136. </view>
  137. </view>
  138. </view>
  139. </view>
  140. </view>
  141. </view>
  142. <view class="u-flex u-row-between" style="flex-wrap: wrap;">
  143. <view class="bigbox" v-for="(item,index) in 6" style="position: relative;" @click="todetail">
  144. <image src="../../static/images/index/discount.png"
  145. style="width: 60rpx;height: 36rpx;position: absolute;left: 12rpx;top: 12rpx;z-index: 10;"
  146. mode="">
  147. </image>
  148. <image src=""
  149. style="width: 340rpx;height: 340rpx;background-color: rgba(119, 119, 119, 1) ;margin-left: -20rpx;margin-top: -18rpx;"
  150. mode=""></image>
  151. <view class="title">
  152. INSTINCT天然百利狗粮 无谷泰迪去
  153. </view>
  154. <view class="">
  155. <text class="money">
  156. ¥258.00
  157. </text>
  158. <text class="weight">
  159. ¥2kg
  160. </text>
  161. </view>
  162. <view class="u-flex" style="flex-wrap: wrap;margin-top: 18rpx;column-gap: 12px;overflow: hidden;">
  163. <view class="taber" style="border: 1rpx solid #E5BC78;color: #E5BC78;">{{i18n.postage}}
  164. </view>
  165. <view class="taber" style="border: 1rpx solid rgba(237, 9, 9, 1);color: rgba(237, 9, 9, 1);">
  166. {{i18n.Trade}}
  167. </view>
  168. <!-- <view class="taber" style="border: 1rpx solid #E5BC78;color: #E5BC78;">以旧换新</view> -->
  169. </view>
  170. </view>
  171. </view>
  172. </view>
  173. <u-popup :show="show" mode='center' :round='16' bgColor='transparent'>
  174. <view style="position: relative;">
  175. <image src="https://cdn.uviewui.com/uview/swiper/swiper1.png"
  176. style="width: 570rpx;height: 764rpx;border-radius: 16rpx;" mode=""></image>
  177. <view class="" style="text-align: center;" @click='show=false'>
  178. <image src="../../static/images/index/close.png" mode="" style="width: 70rpx;height: 70rpx;">
  179. </image>
  180. </view>
  181. </view>
  182. </u-popup>
  183. <view class="" style="height: 160rpx;"></view>
  184. <kj-tabbar :value1=1></kj-tabbar>
  185. </view>
  186. </template>
  187. <script>
  188. export default {
  189. data() {
  190. return {
  191. //顶部分段器
  192. list: [],
  193. current: 1,
  194. //tabs
  195. list1: [{
  196. name: '推荐',
  197. }, {
  198. name: '数码'
  199. }, {
  200. name: '生鲜'
  201. }, {
  202. name: '美妆'
  203. }, {
  204. name: '生鲜'
  205. }, {
  206. name: '美妆'
  207. }],
  208. //轮播图
  209. banner: [
  210. 'https://cdn.uviewui.com/uview/swiper/swiper1.png',
  211. 'https://cdn.uviewui.com/uview/swiper/swiper2.png',
  212. 'https://cdn.uviewui.com/uview/swiper/swiper3.png',
  213. ],
  214. show: true,
  215. timer: ''
  216. }
  217. },
  218. computed: {
  219. i18n() {
  220. return this.$t('index')
  221. }
  222. },
  223. onLoad(options) {
  224. this.list = [this.i18n.border,this.i18n.shop]
  225. // this.seater()
  226. if (options.current) {
  227. this.current = options.current
  228. }
  229. },
  230. methods: {
  231. //物流计算器
  232. counter() {
  233. uni.navigateTo({
  234. url: '/pageA/counter'
  235. })
  236. },
  237. //消息
  238. tochat() {
  239. uni.navigateTo({
  240. url: '/pageA/chat/news'
  241. })
  242. },
  243. //商品分类
  244. shoptype() {
  245. uni.navigateTo({
  246. url: '/pageA/shoptype'
  247. })
  248. },
  249. //分段器切换
  250. sectionChange(index) {
  251. this.current = index;
  252. console.log(index);
  253. if (this.current == 0) {
  254. uni.switchTab({
  255. url: '/pages/express/express?current=0'
  256. })
  257. this.current = 1
  258. }
  259. },
  260. //详情
  261. todetail() {
  262. uni.navigateTo({
  263. url: '/pageA/productdetails'
  264. })
  265. }
  266. }
  267. }
  268. </script>
  269. <style lang="scss" scoped>
  270. .index-navbar {
  271. position: sticky;
  272. top: 0;
  273. left: 0;
  274. width: 750rpx;
  275. z-index: 100;
  276. }
  277. ::v-deep .u-tabs {
  278. width: 560rpx;
  279. }
  280. .taber {
  281. border-radius: 4rpx;
  282. padding: 4rpx 8rpx;
  283. margin-bottom: 10rpx;
  284. }
  285. .title {
  286. font-family: SFPro, SFPro;
  287. font-weight: 400;
  288. font-size: 26rpx;
  289. color: #222222;
  290. line-height: 30rpx;
  291. text-align: left;
  292. font-style: normal;
  293. width: 300rpx;
  294. height: 72rpx;
  295. }
  296. .weight {
  297. font-family: SFPro, SFPro;
  298. font-weight: 400;
  299. font-size: 20rpx;
  300. color: #888888;
  301. line-height: 24rpx;
  302. text-align: left;
  303. font-style: normal;
  304. margin-left: 12rpx;
  305. }
  306. .shopname {
  307. font-family: PingFangSC, PingFang SC;
  308. font-weight: 400;
  309. font-size: 20rpx;
  310. color: #666666;
  311. line-height: 28rpx;
  312. text-align: left;
  313. font-style: normal;
  314. }
  315. .money {
  316. font-family: HarmonyOS_Sans_Medium;
  317. font-size: 28rpx;
  318. color: #F83224;
  319. line-height: 38rpx;
  320. text-align: right;
  321. font-style: normal;
  322. }
  323. .biaoqian {
  324. height: 28rpx;
  325. border-radius: 6rpx;
  326. padding: 6rpx;
  327. margin-left: 8rpx;
  328. font-family: PingFangSC, PingFang SC;
  329. font-weight: 400;
  330. font-size: 20rpx;
  331. color: #FFFFFF;
  332. line-height: 28rpx;
  333. text-align: center;
  334. }
  335. .tag {
  336. // height: 28rpx;
  337. border-radius: 14rpx 14rpx 14rpx 0rpx;
  338. border: 1rpx solid #FFFFFF;
  339. padding: 6rpx;
  340. text-align: center;
  341. font-family: PingFangSC, PingFang SC;
  342. font-weight: 400;
  343. font-size: 20rpx;
  344. color: #FFFFFF;
  345. line-height: 28rpx;
  346. text-align: center;
  347. font-style: normal;
  348. box-sizing: border-box;
  349. // margin-left: -15rpx;
  350. }
  351. .bigbox {
  352. width: 340rpx;
  353. // height: 468rpx;
  354. background: #FFFFFF;
  355. border-radius: 12rpx;
  356. border: 2rpx solid #FFFFFF;
  357. margin-bottom: 22rpx;
  358. padding: 18rpx 20rpx;
  359. box-sizing: border-box;
  360. }
  361. .smallbox {
  362. width: 340rpx;
  363. height: 226rpx;
  364. background: #FFFFFF;
  365. border-radius: 12rpx;
  366. border: 2rpx solid #FFFFFF;
  367. margin-bottom: 22rpx;
  368. padding: 18rpx 20rpx;
  369. box-sizing: border-box;
  370. }
  371. .shopback {
  372. width: 750rpx;
  373. min-height: 1216rpx;
  374. background: #F4F4F4;
  375. border-radius: 28rpx 28rpx 0rpx 0rpx;
  376. padding: 26rpx 24rpx;
  377. box-sizing: border-box;
  378. }
  379. .fenlei {
  380. font-family: PingFangSC, PingFang SC;
  381. font-weight: 400;
  382. font-size: 28rpx;
  383. color: #222222;
  384. line-height: 40rpx;
  385. text-align: right;
  386. font-style: normal;
  387. margin-left: 8rpx;
  388. }
  389. .search {
  390. width: 702rpx;
  391. height: 68rpx;
  392. background: #FFFFFF;
  393. border-radius: 34rpx;
  394. padding: 6rpx 6rpx 6rpx 36rpx;
  395. display: flex;
  396. align-items: center;
  397. justify-content: space-between;
  398. box-sizing: border-box;
  399. .right {
  400. width: 100rpx;
  401. height: 56rpx;
  402. background: #ED0909;
  403. border-radius: 28rpx;
  404. font-family: PingFangSC, PingFang SC;
  405. font-weight: 400;
  406. font-size: 26rpx;
  407. color: #FFFFFF;
  408. line-height: 56rpx;
  409. text-align: center;
  410. }
  411. }
  412. .border {
  413. width: 2rpx;
  414. height: 24rpx;
  415. border: 2rpx solid #979797;
  416. opacity: 0.2;
  417. background-color: #979797;
  418. }
  419. // ::v-deep .u-navbar__content.data-v-1194bf80 {
  420. // background-color: rgba(0, 0, 0, 0) !important;
  421. // }
  422. // ::v-deep .u-status-bar.data-v-13f16680 {
  423. // background-color: rgba(0, 0, 0, 0) !important;
  424. // }
  425. ::v-deep .u-subsection--button.data-v-b14d3440 {
  426. /* padding: 6rpx 34rpx !important; */
  427. border-radius: 64rpx !important;
  428. }
  429. ::v-deep .u-subsection--button__bar.data-v-b14d3440 {
  430. border-radius: 32rpx !important;
  431. }
  432. </style>