xuxy
2024-07-27 dcc7b2d14fcbac97fb6d2c8975a3cd93dfbcc458
sub_pages/customer/shopping/shopping.vue
@@ -24,15 +24,16 @@
        <view v-for="(dto,j) of item.flowerList" :key="j">
          <u-divider v-if="j>0"></u-divider>
          <u-swipe-action>
            <u-swipe-action-item
                :options="options1"
                @click="(e)=>{clickSwipeButton(dto)}"
            >
                  <u-swipe-action-item :options="options1" @click="(e)=>{clickSwipeButton(dto)}">
              <view class="item-each flex">
                <radio :checked="ids.indexOf(dto.id)>=0" @click="changeItem(dto,'flower')"></radio>
                <image class="img img100 m-r-6" :src="dto.url||dto.cover"></image>
                <view class="flex1">
                  <view class="title"><span class="m-r-5" style="display: inline-block;">{{item.categoryStr||''}}</span><span v-if="item.levelStr" class="m-r-5" style="display: inline-block;">{{ item.levelStr || '' }}</span>{{ dto.name || '-' }}</view>
                           <view class="title"><span class="m-r-5"
                                 style="display: inline-block;">{{item.categoryStr||''}}</span><span
                                 v-if="item.levelStr" class="m-r-5"
                                 style="display: inline-block;">{{ item.levelStr || '' }}</span>{{ dto.name || '-' }}
                           </view>
                  <view class="price">
                    {{ dto.price || '-' }}元/扎
                  </view>
@@ -140,12 +141,14 @@
        return
      }
      this.$message.showLoading()
      const {code, data} = await http.request('post', '/api/customer/flower/order/confirm/info', {
            const {
               code,
               data
            } = await http.request('post', '/api/customer/flower/order/confirm/info', {
            data: {
              flowers: arr,
            }
          }
      )
            })
      this.$message.hideLoading()
      if (code === 0) {
        this.$storage.setItem('_cache_shopping_dto',JSON.stringify(data))
@@ -158,12 +161,13 @@
      //删除商品,重新加载数据?
      this.$message.showLoading()
      const {code} = await http.request('get', '/api/customer/flower/cart/delete', {
            const {
               code
            } = await http.request('get', '/api/customer/flower/cart/delete', {
            params: {
              id: item.id,
            }
          }
      )
            })
      this.$message.hideLoading()
      if (code === 0) {
        if (this.ids.indexOf(item.id) >= 0) {
@@ -255,26 +259,34 @@
        return
      }
      this.$message.showLoading()
      const {code} = await http.request('post', '/api/customer/flower/cart/change-num', {
            const {
               code
            } = await http.request('post', '/api/customer/flower/cart/change-num', {
            data: {
              id: dto.id,
              num: addnum
            }
          }
      )
            })
      this.$message.hideLoading()
      if (code === 0) {
        dto.num += addnum
      }
    },
    async init() {
            if (!this.currentInfo.id) {
               this.$message.showToast('请先登录')
               return
            }
      if (!this.currentInfo.customerDTO) {
        this.$message.showToast('请先前往个人中心补充个人信息')
        return
      }
      this.$message.showLoading()
      await this.$store.dispatch('sign_clear', 'shopping');
      const {code, data} = await this.$http.request('get', '/api/customer/flower/cart/list', {})
            const {
               code,
               data
            } = await this.$http.request('get', '/api/customer/flower/cart/list', {})
      this.$message.hideLoading()
      this.list = []
      if (code === 0) {
@@ -381,7 +393,7 @@
    padding-left: 26rpx;
    .icon-clock {
      margin-top: 9rpx;
            margin-top: 12rpx;
    }
  }
}