## 商品详情替换新接口;
This commit is contained in:
		
							parent
							
								
									6eea4cdd9e
								
							
						
					
					
						commit
						eb2dd0451c
					
				| 
						 | 
					@ -15,7 +15,8 @@ const http = uni.$u.http
 | 
				
			||||||
//商品列表
 | 
					//商品列表
 | 
				
			||||||
export const getAllGoods = (params) => http.post('/sale/api/wares/query-spe-wares', params)
 | 
					export const getAllGoods = (params) => http.post('/sale/api/wares/query-spe-wares', params)
 | 
				
			||||||
//商品详情
 | 
					//商品详情
 | 
				
			||||||
export const waresDetail = (params) => http.post('/sale/api/wares/query-spe-wares-detail', params)
 | 
					// export const waresDetail = (params) => http.post('/sale/api/wares/query-spe-wares-detail', params)
 | 
				
			||||||
 | 
					export const waresDetail = (params) => http.post('/sale/api/retail-wares/wares-detail', params)
 | 
				
			||||||
//嗨粉海粉短信
 | 
					//嗨粉海粉短信
 | 
				
			||||||
export const verification = (params) => http.get('/member/api/sms/fans-verification', { params })
 | 
					export const verification = (params) => http.get('/member/api/sms/fans-verification', { params })
 | 
				
			||||||
//嗨粉选择省市区
 | 
					//嗨粉选择省市区
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -7,7 +7,8 @@ export const getAllGoods = params =>
 | 
				
			||||||
  http.post('/sale/api/wares/query-spe-wares', params)
 | 
					  http.post('/sale/api/wares/query-spe-wares', params)
 | 
				
			||||||
//商品详情
 | 
					//商品详情
 | 
				
			||||||
export const waresDetail = params =>
 | 
					export const waresDetail = params =>
 | 
				
			||||||
  http.post('/sale/api/wares/query-spe-wares-detail', params)
 | 
					  // http.post('/sale/api/wares/query-spe-wares-detail', params)
 | 
				
			||||||
 | 
					  http.post('/sale/api/retail-wares/wares-detail', params)
 | 
				
			||||||
//获取国家
 | 
					//获取国家
 | 
				
			||||||
export const countryList = params =>
 | 
					export const countryList = params =>
 | 
				
			||||||
  http.get('/system/api/country/list', { params })
 | 
					  http.get('/system/api/country/list', { params })
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -169,7 +169,7 @@
 | 
				
			||||||
        <view class="zhan"></view>
 | 
					        <view class="zhan"></view>
 | 
				
			||||||
        <view class="pop">
 | 
					        <view class="pop">
 | 
				
			||||||
          <view
 | 
					          <view
 | 
				
			||||||
            v-for="(item, index) in goodDetail.productParams"
 | 
					            v-for="(item, index) in goodDetail.productList"
 | 
				
			||||||
            :key="item.productId"
 | 
					            :key="item.productId"
 | 
				
			||||||
            class="pop_c"
 | 
					            class="pop_c"
 | 
				
			||||||
          >
 | 
					          >
 | 
				
			||||||
| 
						 | 
					@ -288,7 +288,7 @@ export default {
 | 
				
			||||||
    addCar() {
 | 
					    addCar() {
 | 
				
			||||||
      let sum = 0
 | 
					      let sum = 0
 | 
				
			||||||
      let selSum = 0
 | 
					      let selSum = 0
 | 
				
			||||||
      this.goodDetail.productParams.forEach(item => {
 | 
					      this.goodDetail.productList.forEach(item => {
 | 
				
			||||||
        sum += item.quantity
 | 
					        sum += item.quantity
 | 
				
			||||||
        item.waresItemsParamsList.forEach(ctem => {
 | 
					        item.waresItemsParamsList.forEach(ctem => {
 | 
				
			||||||
          selSum += ctem.quantity
 | 
					          selSum += ctem.quantity
 | 
				
			||||||
| 
						 | 
					@ -309,7 +309,7 @@ export default {
 | 
				
			||||||
        productGroup: [],
 | 
					        productGroup: [],
 | 
				
			||||||
        pkCountry: this.pkCountry,
 | 
					        pkCountry: this.pkCountry,
 | 
				
			||||||
      }
 | 
					      }
 | 
				
			||||||
      this.goodDetail.productParams.forEach(item => {
 | 
					      this.goodDetail.productList.forEach(item => {
 | 
				
			||||||
        item.waresItemsParamsList.forEach(ctem => {
 | 
					        item.waresItemsParamsList.forEach(ctem => {
 | 
				
			||||||
          if (ctem.quantity != 0) {
 | 
					          if (ctem.quantity != 0) {
 | 
				
			||||||
            carList.productGroup.push({
 | 
					            carList.productGroup.push({
 | 
				
			||||||
| 
						 | 
					@ -385,7 +385,7 @@ export default {
 | 
				
			||||||
          this.bannerImgList = this.bannerImgList.filter(
 | 
					          this.bannerImgList = this.bannerImgList.filter(
 | 
				
			||||||
            item => item && item.trim()
 | 
					            item => item && item.trim()
 | 
				
			||||||
          )
 | 
					          )
 | 
				
			||||||
          this.goodDetail.productParams.forEach((item, index) => {
 | 
					          this.goodDetail.productList.forEach((item, index) => {
 | 
				
			||||||
            item.waresItemsParamsList.forEach((ctem, cndex) => {
 | 
					            item.waresItemsParamsList.forEach((ctem, cndex) => {
 | 
				
			||||||
              ctem.quantity = 0
 | 
					              ctem.quantity = 0
 | 
				
			||||||
              ctem.maxNum = 0
 | 
					              ctem.maxNum = 0
 | 
				
			||||||
| 
						 | 
					@ -397,7 +397,7 @@ export default {
 | 
				
			||||||
            })
 | 
					            })
 | 
				
			||||||
          })
 | 
					          })
 | 
				
			||||||
          // 赋初值
 | 
					          // 赋初值
 | 
				
			||||||
          this.goodDetail.productParams.forEach((item, index) => {
 | 
					          this.goodDetail.productList.forEach((item, index) => {
 | 
				
			||||||
            item.waresItemsParamsList.forEach((ctem, cndex) => {
 | 
					            item.waresItemsParamsList.forEach((ctem, cndex) => {
 | 
				
			||||||
              if (cndex == 0) {
 | 
					              if (cndex == 0) {
 | 
				
			||||||
                this.$set(ctem, 'quantity', item.quantity)
 | 
					                this.$set(ctem, 'quantity', item.quantity)
 | 
				
			||||||
| 
						 | 
					@ -415,7 +415,7 @@ export default {
 | 
				
			||||||
          this.$set(this.goodDetail, 'retailPrice', 0)
 | 
					          this.$set(this.goodDetail, 'retailPrice', 0)
 | 
				
			||||||
          this.$set(this.goodDetail, 'goodsAchive', 0)
 | 
					          this.$set(this.goodDetail, 'goodsAchive', 0)
 | 
				
			||||||
          this.$set(this.goodDetail, 'goodsAssAchive', 0)
 | 
					          this.$set(this.goodDetail, 'goodsAssAchive', 0)
 | 
				
			||||||
          this.goodDetail.productParams.forEach(item => {
 | 
					          this.goodDetail.productList.forEach(item => {
 | 
				
			||||||
            if (this.specialArea == 31) {
 | 
					            if (this.specialArea == 31) {
 | 
				
			||||||
              if (this.user.isMakerSpace == 0) {
 | 
					              if (this.user.isMakerSpace == 0) {
 | 
				
			||||||
                this.goodDetail.goodsPrice += parseFloat(item.priceTotal)
 | 
					                this.goodDetail.goodsPrice += parseFloat(item.priceTotal)
 | 
				
			||||||
| 
						 | 
					@ -446,7 +446,7 @@ export default {
 | 
				
			||||||
    },
 | 
					    },
 | 
				
			||||||
    // 拼接已选
 | 
					    // 拼接已选
 | 
				
			||||||
    ggString() {
 | 
					    ggString() {
 | 
				
			||||||
      this.goodDetail.productParams.forEach(item => {
 | 
					      this.goodDetail.productList.forEach(item => {
 | 
				
			||||||
        item.skuString = ''
 | 
					        item.skuString = ''
 | 
				
			||||||
        item.waresItemsParamsList.forEach((ctem, cndex) => {
 | 
					        item.waresItemsParamsList.forEach((ctem, cndex) => {
 | 
				
			||||||
          if (ctem.quantity > 0) {
 | 
					          if (ctem.quantity > 0) {
 | 
				
			||||||
| 
						 | 
					@ -455,7 +455,7 @@ export default {
 | 
				
			||||||
        })
 | 
					        })
 | 
				
			||||||
      })
 | 
					      })
 | 
				
			||||||
      let skuString = ''
 | 
					      let skuString = ''
 | 
				
			||||||
      this.goodDetail.productParams.forEach(item => {
 | 
					      this.goodDetail.productList.forEach(item => {
 | 
				
			||||||
        skuString += item.productName + item.skuString
 | 
					        skuString += item.productName + item.skuString
 | 
				
			||||||
      })
 | 
					      })
 | 
				
			||||||
      if (skuString.length > 19) {
 | 
					      if (skuString.length > 19) {
 | 
				
			||||||
| 
						 | 
					@ -465,11 +465,11 @@ export default {
 | 
				
			||||||
      }
 | 
					      }
 | 
				
			||||||
    },
 | 
					    },
 | 
				
			||||||
    getNum(index, cndex, { value }) {
 | 
					    getNum(index, cndex, { value }) {
 | 
				
			||||||
      this.goodDetail.productParams[index].waresItemsParamsList[
 | 
					      this.goodDetail.productList[index].waresItemsParamsList[
 | 
				
			||||||
        cndex
 | 
					        cndex
 | 
				
			||||||
      ].quantity = value
 | 
					      ].quantity = value
 | 
				
			||||||
      let ggNum = 0
 | 
					      let ggNum = 0
 | 
				
			||||||
      this.goodDetail.productParams[index].waresItemsParamsList.forEach(
 | 
					      this.goodDetail.productList[index].waresItemsParamsList.forEach(
 | 
				
			||||||
        (item, iindex) => {
 | 
					        (item, iindex) => {
 | 
				
			||||||
          if (iindex == cndex) {
 | 
					          if (iindex == cndex) {
 | 
				
			||||||
            ggNum += value
 | 
					            ggNum += value
 | 
				
			||||||
| 
						 | 
					@ -478,14 +478,14 @@ export default {
 | 
				
			||||||
          }
 | 
					          }
 | 
				
			||||||
        }
 | 
					        }
 | 
				
			||||||
      )
 | 
					      )
 | 
				
			||||||
      if (this.goodDetail.productParams[index].quantity - value >= 0) {
 | 
					      if (this.goodDetail.productList[index].quantity - value >= 0) {
 | 
				
			||||||
        this.goodDetail.productParams[index].waresItemsParamsList.forEach(
 | 
					        this.goodDetail.productList[index].waresItemsParamsList.forEach(
 | 
				
			||||||
          (stem, sndex) => {
 | 
					          (stem, sndex) => {
 | 
				
			||||||
            if (sndex != cndex) {
 | 
					            if (sndex != cndex) {
 | 
				
			||||||
              this.$set(
 | 
					              this.$set(
 | 
				
			||||||
                stem,
 | 
					                stem,
 | 
				
			||||||
                'maxNum',
 | 
					                'maxNum',
 | 
				
			||||||
                this.goodDetail.productParams[index].quantity -
 | 
					                this.goodDetail.productList[index].quantity -
 | 
				
			||||||
                  (ggNum - stem.quantity)
 | 
					                  (ggNum - stem.quantity)
 | 
				
			||||||
              )
 | 
					              )
 | 
				
			||||||
            }
 | 
					            }
 | 
				
			||||||
| 
						 | 
					@ -499,7 +499,7 @@ export default {
 | 
				
			||||||
    },
 | 
					    },
 | 
				
			||||||
    calPrice() {
 | 
					    calPrice() {
 | 
				
			||||||
      if (this.user.pkCountry == 1) {
 | 
					      if (this.user.pkCountry == 1) {
 | 
				
			||||||
        this.goodDetail.productParams.forEach(item => {
 | 
					        this.goodDetail.productList.forEach(item => {
 | 
				
			||||||
          item.waresItemsParamsList.forEach(ctem => {
 | 
					          item.waresItemsParamsList.forEach(ctem => {
 | 
				
			||||||
            ctem.priceTotal = parseFloat(ctem.price) * ctem.quantity
 | 
					            ctem.priceTotal = parseFloat(ctem.price) * ctem.quantity
 | 
				
			||||||
            ctem.assAchieveTotal = ctem.assAchieve * ctem.quantity
 | 
					            ctem.assAchieveTotal = ctem.assAchieve * ctem.quantity
 | 
				
			||||||
| 
						 | 
					@ -510,7 +510,7 @@ export default {
 | 
				
			||||||
          })
 | 
					          })
 | 
				
			||||||
        })
 | 
					        })
 | 
				
			||||||
      } else {
 | 
					      } else {
 | 
				
			||||||
        this.goodDetail.productParams.forEach(item => {
 | 
					        this.goodDetail.productList.forEach(item => {
 | 
				
			||||||
          item.waresItemsParamsList.forEach(ctem => {
 | 
					          item.waresItemsParamsList.forEach(ctem => {
 | 
				
			||||||
            ctem.priceTotal = ctem.price * ctem.quantity
 | 
					            ctem.priceTotal = ctem.price * ctem.quantity
 | 
				
			||||||
            ctem.achieveTotal = ctem.achieve * ctem.quantity
 | 
					            ctem.achieveTotal = ctem.achieve * ctem.quantity
 | 
				
			||||||
| 
						 | 
					@ -523,7 +523,7 @@ export default {
 | 
				
			||||||
      let retailPrice = 0
 | 
					      let retailPrice = 0
 | 
				
			||||||
      let achieve = 0
 | 
					      let achieve = 0
 | 
				
			||||||
      let assAchieve = 0
 | 
					      let assAchieve = 0
 | 
				
			||||||
      this.goodDetail.productParams.forEach(item => {
 | 
					      this.goodDetail.productList.forEach(item => {
 | 
				
			||||||
        item.waresItemsParamsList.forEach(ctem => {
 | 
					        item.waresItemsParamsList.forEach(ctem => {
 | 
				
			||||||
          price += ctem.priceTotal
 | 
					          price += ctem.priceTotal
 | 
				
			||||||
          vipPrice += ctem.vipPriceTotal
 | 
					          vipPrice += ctem.vipPriceTotal
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Loading…
	
		Reference in New Issue