修改页面
This commit is contained in:
@ -28,29 +28,41 @@
|
||||
<view v-show="!showHistory" class="content">
|
||||
<mescroll-body ref="mescroll" @init="mescrollInit" @down="downCallback" :up="upOption" :down="downOption" @up="upCallback">
|
||||
<view v-for="(item, index) in goodsList" :key="index">
|
||||
<view class="bg-white row u-m-b-20 u-p-20">
|
||||
<view class="">
|
||||
<u-image :src="item.image" width="136" height="136" border-radius="16"></u-image>
|
||||
</view>
|
||||
<view class="u-m-l-16 w-full row-start u-row-between">
|
||||
<view>
|
||||
<view class="u-line-2 u-p-t-10">{{item.name}}</view>
|
||||
<view class="u-p-t-20 row-between">
|
||||
<view class="row">
|
||||
<view class="primary">
|
||||
<price-format :price="item.price" :subscriptSize="22" :firstSize="34" :secondSize="26"></price-format>
|
||||
</view>
|
||||
<view class="u-m-l-8">
|
||||
<price-format :price="item.market_price" :lineThrough="true" color="#C0C0C0" :subscriptSize="22" :firstSize="22" :secondSize="22"></price-format>
|
||||
<navigator :url="`/pages/shop/shop?id=${item.id}`" hover-class="none" class="bg-white row u-m-b-20 u-p-20">
|
||||
<!-- <view class="bg-white row u-m-b-20 u-p-20"> -->
|
||||
<view class="">
|
||||
<u-image :src="item.image" width="136" height="136" border-radius="16"></u-image>
|
||||
</view>
|
||||
<view class="u-m-l-16 w-full row-start u-row-between">
|
||||
<view>
|
||||
<view class="u-line-2 u-p-t-10">{{item.name}}</view>
|
||||
<view class="u-p-t-20 row-between">
|
||||
<view class="row">
|
||||
<view class="primary">
|
||||
<price-format :price="item.price" :subscriptSize="22" :firstSize="34" :secondSize="26"></price-format>
|
||||
</view>
|
||||
<view class="u-m-l-8">
|
||||
<price-format :price="item.market_price" :lineThrough="true" color="#C0C0C0" :subscriptSize="22" :firstSize="22" :secondSize="22"></price-format>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="column-end">
|
||||
<view @click.stop="addCartFun(item)">
|
||||
<u-icon name="plus-circle-fill" color="#254062" size="48"></u-icon>
|
||||
</view>
|
||||
<!-- <u-button
|
||||
@click.stop="openSpec(item)"
|
||||
hover-class="none"
|
||||
:customStyle="{width: '116rpx', height: '46rpx', lineHeight: '46rpx', fontSize: '24rpx', backgroundColor: themeColor, color: '#fff', border: 'none', paddingTop: '8rpx'}"
|
||||
:hair-line="false"
|
||||
shape="circle">
|
||||
选规格
|
||||
</u-button> -->
|
||||
</view>
|
||||
</view>
|
||||
<view class="column-end" @click.stop="count++">
|
||||
<u-icon name="plus-circle-fill" color="#254062" size="48"></u-icon>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<!-- </view> -->
|
||||
</navigator>
|
||||
</view>
|
||||
</mescroll-body>
|
||||
|
||||
@ -101,7 +113,8 @@
|
||||
</view>
|
||||
</view>
|
||||
</u-popup>
|
||||
<shop-spec v-model="showSpec" @close="showSpec = false"></shop-spec>
|
||||
|
||||
<shop-spec v-model="showSpec" :name="goodsName" :spec="goodsSpec" @close="showSpec = false" @confirm="confirmSpec"></shop-spec>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
@ -109,7 +122,8 @@
|
||||
import {
|
||||
getGoodsSearch,
|
||||
getSearchpage,
|
||||
clearSearch
|
||||
clearSearch,
|
||||
addCart,
|
||||
} from '@/api/store'
|
||||
import {
|
||||
trottle,
|
||||
@ -150,7 +164,9 @@
|
||||
numberVal: 1,
|
||||
showCart: false,
|
||||
showSpec: false,
|
||||
count: 0
|
||||
count: 0,
|
||||
goodsName: '',
|
||||
goodsSpec: [],
|
||||
};
|
||||
},
|
||||
onLoad(options) {
|
||||
@ -248,6 +264,35 @@
|
||||
this.keyword = item
|
||||
this.showHistory = false
|
||||
this.onRefresh();
|
||||
},
|
||||
|
||||
// 打开弹框
|
||||
openSpec(item) {
|
||||
console.log("123>>>", 123);
|
||||
|
||||
this.showSpec = true
|
||||
this.goodsName = item.name
|
||||
this.goodsSpec = item.goods_spec
|
||||
},
|
||||
|
||||
// 确认选择的商品规格
|
||||
confirmSpec() {
|
||||
|
||||
},
|
||||
|
||||
// 选择商品
|
||||
async addCartFun(item) {
|
||||
const {
|
||||
code,
|
||||
data,
|
||||
msg
|
||||
} = await addCart({
|
||||
item_id: item.id,
|
||||
goods_num: 1
|
||||
});
|
||||
if (code == 1) {
|
||||
this.getCartListFun()
|
||||
}
|
||||
}
|
||||
},
|
||||
watch: {
|
||||
|
||||
@ -35,7 +35,7 @@
|
||||
<text class="text-999 ml20">随时退 过期自动退</text>
|
||||
</view>
|
||||
<view>
|
||||
<u-button @click="showSpec = true" hover-class="none"
|
||||
<u-button @click="openSpec" hover-class="none"
|
||||
:customStyle="{width: '116rpx', height: '46rpx', lineHeight: '46rpx', fontSize: '24rpx', backgroundColor: themeColor, color: '#fff', border: 'none', paddingTop: '8rpx'}"
|
||||
:hair-line="false"
|
||||
shape="circle">
|
||||
@ -48,20 +48,20 @@
|
||||
|
||||
<view class="u-m-t-24">
|
||||
<view class="u-m-l-48 nr">详情</view>
|
||||
<view class="bg-white mx24 px24 u-m-t-24 u-padding-top-20 u-padding-bottom-20 br24">
|
||||
<view class="bg-white mx24 px24 u-m-t-24 u-p-t-20 u-p-b-20 br24">
|
||||
<u-image :src="cloudPath + 'img/banner.png'" height="600"></u-image>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<view class="u-m-t-24">
|
||||
<view class="u-m-l-48 nr">购买须知</view>
|
||||
<view class="bg-white mx24 px24 u-m-t-24 u-padding-top-20 u-padding-bottom-20 br24">
|
||||
<view class="bg-white mx24 px24 u-m-t-24 u-p-t-20 u-p-b-20 br24">
|
||||
这里是购买须知的内容
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<view class="fixed bg-white row-between px48 u-padding-top-20 u-padding-bottom-20">
|
||||
<view class="fixed bg-white row-between px48 u-p-t-20 u-p-b-20">
|
||||
<view class="column u-text-center">
|
||||
<view class="row-center">
|
||||
<u-image :src="cloudPath + 'img/icon_store.png'" width="48" height="48"></u-image>
|
||||
@ -78,7 +78,7 @@
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<shop-spec v-model="showSpec" :spec="goods.goods_spec" @close="showSpec = false" @confirm="confirmSpec"></shop-spec>
|
||||
<shop-spec v-model="showSpec" :name="goods.name" :spec="goods.goods_spec" @close="showSpec = false" @confirm="confirmSpec"></shop-spec>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
@ -127,6 +127,11 @@
|
||||
}
|
||||
},
|
||||
|
||||
// 打开商品规格
|
||||
openSpec() {
|
||||
this.showSpec = true
|
||||
},
|
||||
|
||||
// 获取选择的商品规格
|
||||
confirmSpec(data) {
|
||||
console.log("data>>>", data.spec);
|
||||
@ -144,7 +149,7 @@
|
||||
spec: this.spec // 选中的商品规格
|
||||
});
|
||||
|
||||
console.log("this.$>>>", this.$store.state.goods.buyGoods);
|
||||
// console.log("this.$>>>", this.$store.state.goods.buyGoods);
|
||||
|
||||
uni.navigateTo({
|
||||
url: `/pages/order_now/order_now`
|
||||
|
||||
Reference in New Issue
Block a user