| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242 |
- <template>
- <view class="component-wrapper" :style="wrapper_style">
- <view v-if="datas.show_title" class="morebox">
- <view :style="title_style" class="title">{{ title }}</view>
- <view class="title2" @click="more">查看更多
- <u-icon :style="img_style2" color="#949494" name="arrow-right" size="14"></u-icon>
- </view>
- </view>
- <view class="bigbox" v-for="(item, index) in list">
- <view class="bimage">
- <image :src="item.soil_cover_pic || emptyImage" :key="index" :style="img_style"></image>
- </view>
- <view class="case_titleblock">
- <view class="case_title">{{item.soil_name}}</view>
- </view>
- <view class="case_title_sm" :style="info_style">{{item.soil_desc}}</view>
- <view class="price_selection">
- <view class="commodity_price">
- 价格:
- <view class="commodity_price_red text-neutral" :style="price_style">¥{{ item.show_price}}</view>
- 元起
- </view>
- <view @click="gobuy(item.id)" class="btn" :style="buttonstyle">选择土地</view>
- </view>
- </view>
- </view>
- </template>
- <script>
- import landApi from '@/api/land/index.js'
- export default {
- props: ['styles', 'datas'],
- data() {
- let siteinfo = getApp().globalData.siteinfo;
- this.landinit()
- return {
- settingFile: siteinfo,
- emptyImage: siteinfo.root_img + '/static/app/image.png',
- landid: [],
- list:[]
- }
- },
- computed: {
- /** 副标题内容 */
- title() {
- return this.datas.title || '土地';
- },
- img_style2() {
- const {
- button_size
- } = this.datas
- return `
- width:${button_size}px;
- height:${button_size}px;
- margin:auto;
- `;
- },
- // 副标题栏样式
- title_style() {
- const {
- text_size,
- text_color,
- } = this.datas;
- return `
- font-size: ${text_size}px;
- color: ${text_color};
- `;
- },
- /** 样式 */
- wrapper_style() {
- if (this.datas) {
- const {
- padding_top,
- padding_bottom,
- padding_left,
- padding_right,
- bg_color
- } = this.datas;
- return `
- background-color:${bg_color};
- padding-top: ${padding_top}px;
- padding-bottom: ${padding_bottom}px;
- padding-left: ${padding_left}px;
- padding-right: ${padding_right}px;
- `;
- }
- },
- img_style() {
- return `
- width: 100%;
- height:450rpx;
- border-top-left-radius: 10px;
- border-top-right-radius: 10px;
- `;
- },
- //按钮设置
- buttonstyle() {
- const {
- border_radius,
- button_color,
- buttontitle_color
- } = this.datas
- return `
- color:${buttontitle_color};
- font-size: 30rpx;
- display: inline-block;
- padding: 15rpx 20rpx;
- background-color:${button_color};
- border-radius:${border_radius}px;
- white-space: nowrap;
- overflow: hidden;
- text-overflow: ellipsis;
- margin-right:10px
- `;
- },
- //土地描述设置
- info_style() {
- const {
- info_color
- } = this.datas
- return `
- color:${info_color};
- `;
- },
- //价格设置
- price_style() {
- const {
- peice_color
- } = this.datas
- return `
- color:${peice_color};
- `;
- },
- },
- methods: {
- landinit() {
- let that = this
- let ids = []
- that.datas.goods.forEach(ele => {
- ids.push(ele.id)
- })
- let res = landApi.getlist({
- gids: ids,
- gtype: 'land',
- }).then(res => {
- if (res.status == 200) {
- that.list = res.data;
- }
- });
- },
- more() {
- uni.switchTab({
- url: '/pages/land/land'
- })
- },
- gobuy(id) {
- uni.navigateTo({
- url: '/pagesB/pages/chooseland/chooseland?landid=' + id
- })
- },
- },
- };
- </script>
- <style lang="less" scoped>
- .component-wrapper {
- .morebox {
- display: flex;
- justify-content: space-between;
- align-items: center;
- padding: 0 12px;
- margin-bottom: 15rpx;
- .title2 {
- font-size: 28rpx;
- display: flex;
- color: #949494;
- align-items: center;
- }
- }
- .bigbox {
- background-color: #ffffff;
- border-radius: 15px;
- padding-bottom: 2px;
- margin-top: 10px;
- .bimage {
- display: flex;
- justify-content: center;
- }
- }
- .case_titleblock {
- display: flex;
- justify-content: flex-start;
- align-items: center;
- padding: 0 10px;
- .case_title {
- font-size: 36rpx;
- height: 75rpx;
- line-height: 75rpx;
- color: #000;
- white-space: nowrap;
- text-overflow: ellipsis;
- overflow: hidden;
- }
- }
- .case_title_sm {
- width: 80%;
- font-size: 30rpx;
- color: #999;
- padding: 0 10px;
- text-overflow: ellipsis;
- overflow: hidden;
- white-space: nowrap;
- }
- .price_selection {
- display: flex;
- justify-content: space-between;
- align-items: center;
- padding: 5rpx 10px;
- margin-bottom: 10px;
- padding-bottom: 5px;
- .commodity_price {
- display: flex;
- font-size: 30rpx;
- color: #333;
- .commodity_price_red {
- font-weight: 800;
- margin: 0 5px;
- color: red;
- }
- }
- }
- }
- </style>
|