| | |
| | | </view>
|
| | |
|
| | | <view class="component-shop-item flex" v-for="(item,index) of list" :key="index"
|
| | | @click="toDetail(item)">
|
| | | <view class="img">
|
| | | >
|
| | | <view class="img" @click.stop="toDetail(item)">
|
| | | <image class="img img100"
|
| | | src="https://hmy-flower.oss-cn-shanghai.aliyuncs.com/ff/fff3027bd0a146478fd1f0aae816a028%E5%BE%AE%E4%BF%A1%E6%88%AA%E5%9B%BE_20240710224139.png">
|
| | | </image>
|
| | |
| | | </view>
|
| | |
|
| | | <view class="m-l-12 info-container flex1">
|
| | | <view class="title">
|
| | | 橙色芭比
|
| | | <view class="price">
|
| | | ¥6.60/扎
|
| | | <view @click.stop="toDetail(item)">
|
| | | <view class="title">
|
| | | 橙色芭比
|
| | | <view class="price">
|
| | | ¥6.60/扎
|
| | | </view>
|
| | | </view>
|
| | | </view>
|
| | | <view class="shop-name">
|
| | | 牛油果泡泡·白色
|
| | | </view>
|
| | | <view class="other-info flex">
|
| | | <view class="m-r-15">
|
| | | 已售:7
|
| | | <view class="shop-name">
|
| | | 牛油果泡泡·白色
|
| | | </view>
|
| | | <view class="m-r-15">
|
| | | 剩余:13
|
| | | </view>
|
| | | <view class="m-r-15">
|
| | | 1支/扎
|
| | | <view class="other-info flex">
|
| | | <view class="m-r-15">
|
| | | 已售:7
|
| | | </view>
|
| | | <view class="m-r-15">
|
| | | 剩余:13
|
| | | </view>
|
| | | <view class="m-r-15">
|
| | | 1支/扎
|
| | | </view>
|
| | | </view>
|
| | | </view>
|
| | | <view class="bottom-buttons flex">
|
| | |
|
| | | <view class="icons flex">
|
| | | <uni-icons v-if="item.shopnum&&item.shopnum>=1" type="minus" size="32"
|
| | | @click.stop="mulnum(item)"></uni-icons>
|
| | | @click.stop="addnum(item,-1)"></uni-icons>
|
| | | <view class="curnums" v-if="item.shopnum&&item.shopnum>=1">{{ item.shopnum }}</view>
|
| | | <uni-icons v-if="!item.shopnum||item.shopnum<=99" type="plus-filled" size="32"
|
| | | @click.stop="addnum(item)"></uni-icons>
|
| | | @click.stop="addnum(item,1)"></uni-icons>
|
| | | </view>
|
| | | </view>
|
| | | </view>
|
| | | </view>
|
| | |
|
| | |
|
| | | <view class="icon-shop" v-if="list&&list.length>0">
|
| | | <view class="icon-shop" v-if="list&&list.length>0" @click="goto('/sub_pages/customer/shopping/shopping',true)">
|
| | | <!-- 购物图标 -->
|
| | | <!-- 如果有购买的东西,就要附带数字了 -->
|
| | | <view v-if="shoptotal>0" class="number">
|
| | |
| | | </template>
|
| | |
|
| | | <script>
|
| | | import http from "../../../plugins/http";
|
| | |
|
| | | export default {
|
| | | data() {
|
| | | return {
|
| | |
| | | this.query.category = options.categoryId || ''
|
| | | this.query.zoneId = options.zoneId || ''
|
| | | this.listApi = '/api/customer/flower/list'
|
| | | this.getList()
|
| | | this.getList('post')
|
| | | this.$http.request('get', '/api/code/value', {
|
| | | params: {
|
| | | type: 'FLOWER_LEVEL'
|
| | |
| | | url: `/sub_pages/customer/trade/detail?id=${item.id}`
|
| | | })
|
| | | },
|
| | | mulnum(item) {
|
| | | if (item.shopnum > 0) {
|
| | | item.shopnum -= 1
|
| | | // mulnum(item) {
|
| | | // if (item.shopnum > 0) {
|
| | | // item.shopnum -= 1
|
| | | // }
|
| | | // this.shoptotal -= 1
|
| | | // this.$forceUpdate()
|
| | | //
|
| | | // },
|
| | | async addnum(item, addnum) {
|
| | | if (!this.currentInfo.id) {
|
| | | await this.$message.confirm('请前往登录')
|
| | | uni.navigateTo({
|
| | | url: '//pages/user/supplier-user'
|
| | | })
|
| | | return
|
| | | }
|
| | | this.shoptotal -= 1
|
| | | this.$forceUpdate()
|
| | | if (!item.shopnum) {
|
| | | item.shopnum = 0
|
| | | }
|
| | | if (item.shopnum + addnum >= 0) {
|
| | |
|
| | | },
|
| | | addnum(item) {
|
| | | if (item.shopnum) {
|
| | | item.shopnum += 1
|
| | | } else {
|
| | | item.shopnum = 1
|
| | | return
|
| | | }
|
| | | this.shoptotal += 1
|
| | | this.$message.showLoading()
|
| | | const {code} = await http.request('post', '/api/api/customer/flower/cart/change-num', {
|
| | | data: {
|
| | | id: item.id,
|
| | | num: addnum
|
| | | }
|
| | | }
|
| | | )
|
| | | this.$message.hideLoading()
|
| | | if (code === 0) {
|
| | | item.shopnum += addnum
|
| | | }
|
| | | // if (item.shopnum) {
|
| | | // item.shopnum += 1
|
| | | // } else {
|
| | | // item.shopnum = 1
|
| | | // }
|
| | | // this.shoptotal += 1
|
| | | this.$forceUpdate()
|
| | | },
|
| | | }
|