123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461 |
- <template>
- <view class="container">
- <view class="top">
- <view class="vheight"></view>
- <view class="input-box flex">
- <view class="input-content flex">
- <view class="iconfont iconsearch"></view>
- <view class="input"><input type="text" v-model="keyword" placeholder="请输入搜索内容" /></view>
- </view>
- <view class="input-button flex" @click="searchNew"><text>搜索</text></view>
- </view>
- </view>
- <view class="box">
- <view class="box-title">
- <view class="left">
- 艺绘
- </view>
- <view class="right" @click="navTo('/pages/index/cangp')">
- 查看更多 >
- </view>
- </view>
- <view class="box-content" v-for="(item,index) in list" @click="buy(item)">
- <view class="img">
- <image :src="item.class_info.uri" mode=""></image>
- </view>
- <view class="content-title">
- <view class="title">
- {{item.class_info.name}}
- </view>
- <view class="text">
- 持有者:{{item.user.nickname}}
- </view>
- <view class="text">
- 价格: <span style = "font-size: 32rpx; color:#A581FF" >¥{{item.price}}</span>
- </view>
- </view>
- </view>
- </view>
- <view class="btm" style="height: 44px;"></view>
- </view>
- </template>
- <script>
- import {
- getBargainList,
- getProducts
- } from '@/api/product.js';
- import {
- nftmall,nftDetail
- } from '@/api/order.js'
- // import {mapState} from 'vuex'
- import {
- loadIndexs
- } from '@/api/index.js'
- import {
- mapState,
- mapMutations
- } from 'vuex';
- // #ifdef H5
- import {
- weixindata,
- shareLoad
- } from '@/utils/wxAuthorized';
- // #endif
- export default {
- data() {
- return {
- list: [], //卡片信息
- page: 1,
- limit: 10,
- loadType: 'more',
- text: [],
- article: [],
- page:1,
- limit:10,
- keyword:'',//搜索内容
- };
- },
- computed: {
- ...mapState(['loginInterceptor', 'baseURL']),
- ...mapState('user', ['hasLogin', 'userInfo'])
- },
- onLoad: function(option) {
- if (this.hasLogin) {
- this.loadIndex()
- this.getProduct()
- }
- },
- onShow: function() {
- if (this.hasLogin) {
- this.loadIndex()
- this.getProduct()
- }
- },
- // onReachBottom() {
- // this.getproducts();
-
- // },
- methods: {
- ...mapMutations(['setLat', 'setLon']),
- //市场列表
- loadIndex() {
- let obj = this
- nftmall({
- page:obj.page,
- limit:obj.limit,
- key_word:obj.keyword
- }).then(res => {
- // console.log(res, 'res');
- obj.list = res.data.list
- // obj.carouselList = res.data.banner
- // console.log(res,'res');
- // obj.list = res.data.info.fastList
- })
- },
- // 搜索
- searchNew(){
- this.page=1;
- this.loadIndex()
- },
- getProduct() {
- let obj = this
- getProducts().then(res => {
- // obj.carouselList = res.data.banner
- // console.log(res,'rrrrrrrrr')
- // obj.list = res.list
- // console.log(obj.list, 'res');
- })
- },
- buy(item) {
- console.log(item, 'res');
- uni.navigateTo({
- url: '/pages/product/product?id=' + item.id+'&isSc=1'
- })
- },
- navTo(url) {
- uni.switchTab({
- url
- })
- },
- // 點擊搜索框
- clickSearch() {
- uni.navigateTo({
- url: '/pages/product/search'
- });
- },
- swiperChange() {}
- }
- };
- </script>
- <style lang="scss">
- page {
- width: 750rpx;
- height: 100%;
- background: #111111;
- }
- .container{
- /* #ifdef H5 */
- padding-top: 100rpx;
- /* #endif */
- /* #ifdef APP */
- padding-top: calc(100rpx + var(--status-bar-height)) ;
- /* #endif */
- }
- .top {
- position: fixed;
- z-index: 9999;
- top: 0;
- left: 0;
- width: 100%;
- .top-bg {
- position: absolute;
- top: 0;
- left: 0;
- right: 0;
- width: 100%;
- height: 100%;
- }
- .top-main {
- position: relative;
- z-index: 2;
- padding: 30rpx;
- .search-box {
- justify-content: center;
- width: 698rpx;
- height: 60rpx;
- background: #191919;
- // box-shadow: 0px 10rpx 20rpx 0px rgba(4, 114, 69, 0.22);
- border-radius: 30rpx;
- .search {
- width: 34rpx;
- height: 34rpx;
- }
- .search-font {
- margin-left: 14rpx;
- font-size: 28rpx;
- font-family: PingFang SC;
- font-weight: 500;
- color: #a4a4a4;
- }
- }
- }
- }
- .box {
- margin: 0 30rpx;
- .box-title {
- display: flex;
- justify-content: space-between;
- .left {
- font-size: 38rpx;
- font-family: PingFang SC;
- font-weight: bold;
- color: #FFFFFF;
- line-height: 120rpx;
- }
- .right {
- font-size: 24rpx;
- font-family: PingFang SC;
- font-weight: 500;
- color: #FFFFFF;
- line-height: 120rpx;
- }
- }
- .box-content {
- width: 690rpx;
- height: 915rpx;
- margin: 50rpx 0;
- .img {
- width: 690rpx;
- height: 690rpx;
- image {
- width: 100%;
- height: 100%;
- }
- }
- .content-title {
- margin-top: -10rpx;
- padding: 30rpx 20rpx;
- border-bottom-left-radius: 10rpx;
- border-bottom-right-radius: 10rpx;
- border: 2rpx solid #533A6A;
- // box-shadow: 0px 0px 20rpx 0px rgba(79,59,103,0.0600);
- .title {
- font-size: 39rpx;
- font-weight: bold;
- color: #FFFFFF;
- margin-bottom: 20rpx;
- }
- .text {
- margin: 10rpx 0;
- color: #FFFFFF;
- font-size: 26rpx;
- }
- }
- }
- }
- .popup-box {
- width: 522rpx;
- height: 605rpx;
- background-color: #ffffff;
- border-radius: 20rpx;
- position: relative;
- .img {
- position: relative;
- top: -56rpx;
- left: 0;
- width: 522rpx;
- height: 132rpx;
- display: flex;
- justify-content: center;
- image {
- border-radius: 20rpx 20rpx 0 0;
- width: 450rpx;
- height: 132rpx;
- }
- }
- .mian {
- margin-top: -44rpx;
- display: flex;
- flex-direction: column;
- align-items: center;
- // padding: 32rpx 32rpx;
- background-color: #ffffff;
- border-radius: 0 0 20rpx 20rpx;
- text-align: center;
- .delivery {
- font-size: 40rpx;
- color: #333333;
- display: flex;
- align-items: center;
- flex-direction: column;
- .title {}
- image {
- margin-top: 48rpx;
- width: 172rpx;
- height: 160rpx;
- }
- }
- .nocancel {
- font-size: 32rpx;
- color: #333333;
- margin-top: 14rpx;
- }
- .comfirm-box {
- margin-top: 52rpx;
- display: flex;
- // margin-bottom: 32rpx;
- // justify-content: space-around;
- .cancel {
- display: flex;
- align-items: center;
- justify-content: center;
- width: 197rpx;
- height: 74rpx;
- border: 1px solid #dcc786;
- border-radius: 38rpx;
- font-size: 32rpx;
- color: #605128;
- }
- .comfirm {
- margin-left: 32rpx;
- display: flex;
- align-items: center;
- justify-content: center;
- width: 197rpx;
- height: 74rpx;
- background: linear-gradient(-90deg, #d1ba77 0%, #f7e8ad 100%);
- border-radius: 38px;
- font-size: 32rpx;
- color: #605128;
- }
- }
- }
- }
- .tongz {
- width: 690rpx;
- height: 70rpx;
- margin: 32rpx auto 0;
- padding: 18rpx 30rpx 18rpx 24rpx;
- align-items: center;
- position: relative;
- .tongz-bg {
- position: absolute;
- top: 0;
- right: 0;
- left: 0;
- width: 690rpx;
- height: 70rpx;
- image {
- width: 100%;
- height: 100%;
- }
- }
- .tongz-left {
- width: 640rpx;
- .image-left {
- width: 28rpx;
- height: 34rpx;
- }
- .tongz-font {
- margin-left: 22rpx;
- font-size: 28rpx;
- font-family: Source Han Sans CN;
- font-weight: 400;
- color: #0f253a;
- }
- }
- .tongz-right {
- position: relative;
- z-index: 11;
- width: 12rpx;
- height: 26rpx;
- image {
- width: 100%;
- height: 100%;
- }
- }
- }
- .vheight{
- height: var(--status-bar-height);
- background-color: #111111;
- }
- .input-box {
- padding: 25rpx;
- background-color: #111111;
- height: 44px;
- .iconsearch {
- font-size: 50rpx;
- }
- .leftIcon{
- padding-right: 10px;
- .icon{
- width: 20px;
- }
- }
- .input-content {
- border-radius: 99rpx;
- flex-grow: 1;
- padding: 10rpx 30rpx;
- background-color: rgba(231, 231, 231, 0.7);
- .input {
- flex-grow: 1;
- input {
- font-size: $font-lg;
- }
- }
- }
- .input-button {
- padding-left: 20rpx;
- font-size: $font-lg;
- height: 100%;
- color: #FFFFFF;
- }
- }
- </style>
|