bazaar.vue 7.9 KB

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