shish 11 месяцев назад
Родитель
Сommit
dfccb9c7f3

+ 3 - 36
hdApp/src/admin/goods/list.vue

@@ -44,12 +44,10 @@
                     <view class="operate-wrap" style="margin-bottom:15upx;">
                       <view v-if="goodsItem.priceType == 1">
                         <!-- 当涨价开关开启时,显示涨价后价格和原价 -->
-                        <view v-if="riseSwitch" class="price-container">
-                          <text class="goods-price" style="font-size:26upx;">¥{{ risePrice(goodsItem) }}</text>
-                          <text class="original-price" style="font-size:22upx;">¥{{ goodsItem.price?parseFloat(goodsItem.price):0 }}</text>
+                        <view class="price-container">
+                          <text class="goods-price" style="font-size:26upx;">¥{{ goodsItem.price?parseFloat(goodsItem.price):0 }}</text>
+                          <text class="original-price" style="font-size:22upx;" v-if="parseFloat(goodsItem.price)!=parseFloat(goodsItem.priceBeforeRise)">¥{{ goodsItem.priceBeforeRise?parseFloat(goodsItem.priceBeforeRise):0 }}</text>
                         </view>
-                        <!-- 当涨价开关关闭时,显示原价 -->
-                        <view v-else class="goods-price" style="font-size:26upx;">¥{{ goodsItem.price?parseFloat(goodsItem.price):0 }}</view>
                       </view>
                       <view class="goods-price" style="font-size:26upx;" v-else>---</view>
                     </view>
@@ -161,7 +159,6 @@ export default {
       searchText:'',
       lastSearchText:'', // 上次的搜索内容
       searchTimer: null, // 搜索防抖定时器
-      riseSwitch: false, // 价格上涨开关
       riseData: {}, // 价格上涨配置
       stockStatus:0, // 1:有库存 2:无库存
       priceStatus:0, // 1:有价格 2:无价格
@@ -220,7 +217,6 @@ export default {
   methods: {
     init(){
       this.getCategoryData()
-      this.getRiseData()
     },
     
     // 新的筛选相关方法
@@ -374,35 +370,6 @@ export default {
         this.resetList();
         this.getGoodsList();
       }
-    },
-    getRiseData() {
-      getRise().then(res => {
-        this.riseData = res.data;
-        //console.log('riseData: ' , this.riseData)
-        this.riseSwitch = this.riseData.riseSwitch == '1' ? true : false;
-      })
-    },
-    
-    // 计算涨价后的价格
-    risePrice(goodsItem) {
-      if (!goodsItem.price || !this.riseData.riseAmount) {
-        return parseFloat(goodsItem.price) || 0;
-      }
-      
-      const originalPrice = parseFloat(goodsItem.price);
-      let newPrice = 0;
-      
-      if (this.riseData.riseType == '0') {
-        // 按比率上涨
-        newPrice = originalPrice * (1 + this.riseData.riseAmount / 100);
-      } else if (this.riseData.riseType == '1') {
-        // 按金额数上涨
-        newPrice = originalPrice + parseFloat(this.riseData.riseAmount);
-      } else {
-        newPrice = originalPrice;
-      }
-      
-      return newPrice;
     }
   }
 };

+ 1 - 1
mallApp/src/pages/home/category.vue

@@ -317,7 +317,7 @@ export default {
     },
     // 列表
     getGoodList () {
-      return getList({...this.form, page: this.list.page,pageSize:10,requestType:'album'}) .then(res => {
+      return getList({...this.form, page: this.list.page,pageSize:10,requestType:'mall'}) .then(res => {
           // 处理商品列表数据,completes方法来自list混入
           // 该方法会处理分页数据,更新list对象的data、page、finished等属性
           // res包含接口返回的商品列表数据,completes方法会将数据添加到this.list.data中

+ 1 - 1
mallApp/src/pages/home/mall.vue

@@ -303,7 +303,7 @@ export default {
     // 列表
     getGoodList () {
       let hdId = this.option.id?this.option.id:0
-      return getList({ cId:this.categoryId, page: this.list.page,pageSize:10,requestType:'mall',searchText: this.searchText,hdId:hdId}) .then(res => {
+      return getList({ cId:this.categoryId, page: this.list.page,pageSize:10,requestType:'album',searchText: this.searchText,hdId:hdId}) .then(res => {
           // 处理商品列表数据,completes方法来自list混入
           // 该方法会处理分页数据,更新list对象的data、page、finished等属性
           // res包含接口返回的商品列表数据,completes方法会将数据添加到this.list.data中