bazaar.vue 8.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462
  1. <template>
  2. <view class="container">
  3. <view class="top">
  4. <!-- <image class="top-bg" src="../../static/img/top-bg.png" mode=""></image> -->
  5. <view class="top-main flex">
  6. <view class="search-box flex" @click="clickSearch()">
  7. <image class="search" src="../../static/icon/search-h.png" mode=""></image>
  8. <view class="search-font">输入关键词搜索</view>
  9. </view>
  10. </view>
  11. <!-- <swiper class="carousel" autoplay="true" duration="400" interval="5000" @change="swiperChange">
  12. <swiper-item v-for="(item, index) in carouselList" :key="index" class="carousel-item"
  13. @click="bannerNavToUrl(item)">
  14. <image :src="item.pic" />
  15. </swiper-item>
  16. </swiper> -->
  17. </view>
  18. <view class="box">
  19. <view class="box-title">
  20. <view class="left">
  21. 艺绘
  22. </view>
  23. <view class="right" @click="navTo('/pages/index/cangp')">
  24. 查看更多 >
  25. </view>
  26. </view>
  27. <view class="box-content" v-for="(item,index) in list" @click="buy(item)">
  28. <view class="img">
  29. <image :src="item.class_info.uri" mode=""></image>
  30. </view>
  31. <view class="content-title">
  32. <view class="title">
  33. {{item.class_info.name}}
  34. </view>
  35. <view class="text">
  36. 持有者:{{item.user.nickname}}
  37. </view>
  38. <view class="text">
  39. 价格: <span style = "font-size: 32rpx; color:#A581FF" >¥{{item.price}}</span>
  40. </view>
  41. </view>
  42. </view>
  43. <!-- <view class="box-content">
  44. <view class="img">
  45. <image src="../../static/index/nvwang.png" mode=""></image>
  46. </view>
  47. <view class="content-title">
  48. <view class="">
  49. 黑道女王
  50. </view>
  51. <view class="text">
  52. 黑道研究会 发行
  53. </view>
  54. <view class="text">
  55. 发行数量: 14521份
  56. </view>
  57. </view>
  58. </view> -->
  59. </view>
  60. <view class="btm" style="height: 44px;"></view>
  61. <!-- 客服 -->
  62. <!-- <uni-popup ref="popupkf" type="center">
  63. <view class="popup-box">
  64. <view class="img"><image src="../../static/img/img009.png" mode=""></image></view>
  65. <view class="mian">
  66. <view class="delivery">
  67. <view class="title">已经为您定制专属客服</view>
  68. <image src="../../static/img/img010.png" mode=""></image>
  69. </view>
  70. <view class="nocancel">客服VX:{{ text }}</view>
  71. <view class="comfirm-box">
  72. <view class="cancel" @click="kfClose()">取消</view>
  73. <view class="comfirm" @click="comfirm(text)">复制微信</view>
  74. </view>
  75. </view>
  76. </view>
  77. </uni-popup> -->
  78. </view>
  79. </template>
  80. <script>
  81. import {
  82. getBargainList,
  83. getProducts
  84. } from '@/api/product.js';
  85. import {
  86. nftmall,nftDetail
  87. } from '@/api/order.js'
  88. // import {mapState} from 'vuex'
  89. import {
  90. loadIndexs
  91. } from '@/api/index.js'
  92. import {
  93. mapState,
  94. mapMutations
  95. } from 'vuex';
  96. // #ifdef H5
  97. import {
  98. weixindata,
  99. shareLoad
  100. } from '@/utils/wxAuthorized';
  101. // #endif
  102. export default {
  103. data() {
  104. return {
  105. isSc:1,//是否是市场
  106. text: '',
  107. checkid: 0,
  108. titleNViewBackground: '',
  109. longitude: 0, //经度
  110. latitude: 0, //纬度
  111. swiperCurrent: 0,
  112. swiperLength: 0,
  113. carouselList: [], //轮播列表
  114. bastList: [], //会员礼包
  115. integralList: [], //兑换专区
  116. list: [], //卡片信息
  117. page: 1,
  118. limit: 10,
  119. loadType: 'more',
  120. text: [],
  121. article: [],
  122. page:1,
  123. limit:10
  124. };
  125. },
  126. computed: {
  127. ...mapState(['loginInterceptor', 'baseURL']),
  128. ...mapState('user', ['hasLogin', 'userInfo'])
  129. },
  130. onLoad: function(option) {
  131. if (this.hasLogin) {
  132. this.loadIndex()
  133. this.getProduct()
  134. }
  135. },
  136. onShow: function() {
  137. if (this.hasLogin) {
  138. this.loadIndex()
  139. this.getProduct()
  140. }
  141. },
  142. // onReachBottom() {
  143. // this.getproducts();
  144. // },
  145. methods: {
  146. ...mapMutations(['setLat', 'setLon']),
  147. //市场列表
  148. loadIndex() {
  149. let obj = this
  150. nftmall({
  151. page:obj.page,
  152. limit:obj.limit
  153. }).then(res => {
  154. // console.log(res, 'res');
  155. obj.list = res.data.list
  156. // obj.carouselList = res.data.banner
  157. // console.log(res,'res');
  158. // obj.list = res.data.info.fastList
  159. })
  160. },
  161. getProduct() {
  162. let obj = this
  163. getProducts().then(res => {
  164. // obj.carouselList = res.data.banner
  165. // console.log(res,'rrrrrrrrr')
  166. // obj.list = res.list
  167. // console.log(obj.list, 'res');
  168. })
  169. },
  170. buy(item) {
  171. console.log(item, 'res');
  172. uni.navigateTo({
  173. url: '/pages/product/product?id=' + item.id+'&isSc='+this.isSc
  174. })
  175. },
  176. navTo(url) {
  177. uni.switchTab({
  178. url
  179. })
  180. },
  181. // 點擊搜索框
  182. clickSearch() {
  183. uni.navigateTo({
  184. url: '/pages/product/search'
  185. });
  186. },
  187. swiperChange() {}
  188. }
  189. };
  190. </script>
  191. <style lang="scss">
  192. page {
  193. width: 750rpx;
  194. height: 100%;
  195. background: #111111;
  196. }
  197. .top {
  198. position: relative;
  199. width: 100%;
  200. // height: 360rpx;
  201. .top-bg {
  202. position: absolute;
  203. top: 0;
  204. left: 0;
  205. right: 0;
  206. width: 100%;
  207. height: 100%;
  208. }
  209. .top-main {
  210. position: relative;
  211. z-index: 2;
  212. padding: 30rpx;
  213. .search-box {
  214. justify-content: center;
  215. width: 698rpx;
  216. height: 60rpx;
  217. background: #191919;
  218. // box-shadow: 0px 10rpx 20rpx 0px rgba(4, 114, 69, 0.22);
  219. border-radius: 30rpx;
  220. .search {
  221. width: 34rpx;
  222. height: 34rpx;
  223. }
  224. .search-font {
  225. margin-left: 14rpx;
  226. font-size: 28rpx;
  227. font-family: PingFang SC;
  228. font-weight: 500;
  229. color: #a4a4a4;
  230. }
  231. }
  232. }
  233. }
  234. .box {
  235. margin: 0 30rpx;
  236. .box-title {
  237. display: flex;
  238. justify-content: space-between;
  239. .left {
  240. font-size: 38rpx;
  241. font-family: PingFang SC;
  242. font-weight: bold;
  243. color: #FFFFFF;
  244. line-height: 120rpx;
  245. }
  246. .right {
  247. font-size: 24rpx;
  248. font-family: PingFang SC;
  249. font-weight: 500;
  250. color: #FFFFFF;
  251. line-height: 120rpx;
  252. }
  253. }
  254. .box-content {
  255. width: 690rpx;
  256. height: 915rpx;
  257. margin: 50rpx 0;
  258. .img {
  259. width: 690rpx;
  260. height: 690rpx;
  261. image {
  262. width: 100%;
  263. height: 100%;
  264. }
  265. }
  266. .content-title {
  267. margin-top: -10rpx;
  268. padding: 30rpx 20rpx;
  269. border-bottom-left-radius: 10rpx;
  270. border-bottom-right-radius: 10rpx;
  271. border: 2rpx solid #533A6A;
  272. // box-shadow: 0px 0px 20rpx 0px rgba(79,59,103,0.0600);
  273. .title {
  274. font-size: 39rpx;
  275. font-weight: bold;
  276. color: #FFFFFF;
  277. margin-bottom: 20rpx;
  278. }
  279. .text {
  280. margin: 10rpx 0;
  281. color: #FFFFFF;
  282. font-size: 26rpx;
  283. }
  284. }
  285. }
  286. }
  287. .popup-box {
  288. width: 522rpx;
  289. height: 605rpx;
  290. background-color: #ffffff;
  291. border-radius: 20rpx;
  292. position: relative;
  293. .img {
  294. position: relative;
  295. top: -56rpx;
  296. left: 0;
  297. width: 522rpx;
  298. height: 132rpx;
  299. display: flex;
  300. justify-content: center;
  301. image {
  302. border-radius: 20rpx 20rpx 0 0;
  303. width: 450rpx;
  304. height: 132rpx;
  305. }
  306. }
  307. .mian {
  308. margin-top: -44rpx;
  309. display: flex;
  310. flex-direction: column;
  311. align-items: center;
  312. // padding: 32rpx 32rpx;
  313. background-color: #ffffff;
  314. border-radius: 0 0 20rpx 20rpx;
  315. text-align: center;
  316. .delivery {
  317. font-size: 40rpx;
  318. color: #333333;
  319. display: flex;
  320. align-items: center;
  321. flex-direction: column;
  322. .title {}
  323. image {
  324. margin-top: 48rpx;
  325. width: 172rpx;
  326. height: 160rpx;
  327. }
  328. }
  329. .nocancel {
  330. font-size: 32rpx;
  331. color: #333333;
  332. margin-top: 14rpx;
  333. }
  334. .comfirm-box {
  335. margin-top: 52rpx;
  336. display: flex;
  337. // margin-bottom: 32rpx;
  338. // justify-content: space-around;
  339. .cancel {
  340. display: flex;
  341. align-items: center;
  342. justify-content: center;
  343. width: 197rpx;
  344. height: 74rpx;
  345. border: 1px solid #dcc786;
  346. border-radius: 38rpx;
  347. font-size: 32rpx;
  348. color: #605128;
  349. }
  350. .comfirm {
  351. margin-left: 32rpx;
  352. display: flex;
  353. align-items: center;
  354. justify-content: center;
  355. width: 197rpx;
  356. height: 74rpx;
  357. background: linear-gradient(-90deg, #d1ba77 0%, #f7e8ad 100%);
  358. border-radius: 38px;
  359. font-size: 32rpx;
  360. color: #605128;
  361. }
  362. }
  363. }
  364. }
  365. .tongz {
  366. width: 690rpx;
  367. height: 70rpx;
  368. margin: 32rpx auto 0;
  369. padding: 18rpx 30rpx 18rpx 24rpx;
  370. align-items: center;
  371. position: relative;
  372. .tongz-bg {
  373. position: absolute;
  374. top: 0;
  375. right: 0;
  376. left: 0;
  377. width: 690rpx;
  378. height: 70rpx;
  379. image {
  380. width: 100%;
  381. height: 100%;
  382. }
  383. }
  384. .tongz-left {
  385. width: 640rpx;
  386. .image-left {
  387. width: 28rpx;
  388. height: 34rpx;
  389. }
  390. .tongz-font {
  391. margin-left: 22rpx;
  392. font-size: 28rpx;
  393. font-family: Source Han Sans CN;
  394. font-weight: 400;
  395. color: #0f253a;
  396. }
  397. }
  398. .tongz-right {
  399. position: relative;
  400. z-index: 11;
  401. width: 12rpx;
  402. height: 26rpx;
  403. image {
  404. width: 100%;
  405. height: 100%;
  406. }
  407. }
  408. }
  409. </style>