瀏覽代碼

产品促销活动

jun 5 月之前
父節點
當前提交
3a7fcfed7b
共有 5 個文件被更改,包括 83 次插入12 次删除
  1. 1 1
      manifest.json
  2. 14 2
      pages/car/index.vue
  3. 49 5
      pages/car/order.vue
  4. 4 1
      pages/index/index.vue
  5. 15 3
      pages/product/index.vue

+ 1 - 1
manifest.json

@@ -1,6 +1,6 @@
 {
     "name" : "开邻智数",
-    "appid" : "__UNI__DE440B9",
+    "appid" : "__UNI__90B60D1",
     "description" : "",
     "versionName" : "1.0.0",
     "versionCode" : "100",

+ 14 - 2
pages/car/index.vue

@@ -14,6 +14,7 @@
 				<view class="box_center">
 					<navigator :url="'/pages/product/index?product_id='+item.product_id" class="car_name">{{item.name}}</navigator>
 					<navigator :url="'/pages/product/index?product_id='+item.product_id" class="car_spec">{{item.spec}}</navigator>
+          <view v-if="item.promo_title" class="promo_title">{{item.promo_title}}</view>
 					<navigator :url="'/pages/product/index?product_id='+item.product_id"  class="car_price">
 						<text class="price">¥{{item.price}}</text>
 						<text class="market_price">¥{{item.market_price}}</text>
@@ -310,11 +311,22 @@
 				width: 300rpx;
 				margin-left: 25rpx;
 				.car_name{
-					max-height: 80rpx;
+					max-height: 60rpx;
 					font-size: 30rpx;
-					line-height: 40rpx;
+					line-height: 30rpx;
 					overflow: hidden;
+          white-space: nowrap; /* 不换行 */
+          overflow: hidden; /* 隐藏超出的内容 */
+          text-overflow: ellipsis; /* 用省略号表示被隐藏的部分 */
 				}
+        .promo_title{
+          max-height: 80rpx;
+          font-size: 20rpx;
+          line-height: 40rpx;
+          overflow: hidden;
+          padding: 0rpx 0rpx;
+          color: #dd524d;
+        }
 				.car_spec{
 					color: #999999;
 					font-size: 24rpx;

+ 49 - 5
pages/car/order.vue

@@ -20,6 +20,7 @@
 				<view class="box_center">
 					<view class="car_name">{{item.name}}</view>
 					<view class="car_spec">{{item.spec}}</view>
+          <view v-if="item.promo_title" class="promo_title">{{item.promo_title}}</view>
 					<view class="car_price">
 						<text class="price">¥{{item.price}}</text>
 					</view>
@@ -30,11 +31,36 @@
 					</view>
 				</view>
 			</view>
+      <view class="car_item" v-for="(item,index) in promoRebateList" :key="index">
+        <view class="box_left">
+          <image class="car_image" :src="item.thumb" mode=""></image>
+        </view>
+        <view class="box_center">
+          <view class="car_name"><text v-if="item.promo_rebate_id">【赠品】</text>{{item.name}}</view>
+          <view class="car_spec">{{item.spec}}</view>
+          <view class="car_price">
+            <text class="price">¥{{item.price}}</text>
+          </view>
+        </view>
+        <view class="box_right">
+          <view class="buy_num_box">
+            <view class="buy_num">共{{item.buy_num}}件</view>
+          </view>
+        </view>
+      </view>
 		</view>
 		<view class="to_select_coupon" v-if="couponList.length" @click="popupCoupon()">
 			<text>优惠券</text>
 			<view class="coupon_deduction">{{couponUsed}}</view>
 		</view>
+    <view class="to_select_coupon" v-if="reduction > 0">
+      <text>满减</text>
+      <view class="coupon_deduction">-{{reduction}}</view>
+    </view>
+    <view class="to_select_coupon" v-if="discount > 0">
+      <text>商品折扣</text>
+      <view class="coupon_deduction">-{{discount}}</view>
+    </view>
 		<view class="bottom_box">
 			<view class="price_box">
 				合计:<text class="price_total">¥{{priceTotal}}</text>
@@ -106,12 +132,16 @@
 				cartList:[],
 				// 优惠券列表
 				couponList:[],
+        //赠品列表
+        promoRebateList:[],
 				// 请求参数
 				requestParam:{
 					cart_ids:"",
 				},
 				// 总价
 				priceTotal:'0.00',
+        discount:'0.00',
+        reduction:'0.00',
 				// 优惠券使用
 				couponUsed:"去使用 >",
 				// 扣减金额
@@ -149,7 +179,10 @@
 			this.$http.request('api/shop_cart/check_list',this.requestParam).then((re)=>{
 				if( re.code == 'success' ){
 					// 赋值
-					this.cartList = re.data;
+					this.cartList         = re.data;
+					this.promoRebateList  = re.promoRebateList;
+					this.discount         = re.discount;
+					this.reduction        = re.reduction;
 					// 结果
 					this.$http.request('api/custom_coupon/get_checked',this.requestParam).then((re)=>{
 						if( re.code == 'success' ){
@@ -494,10 +527,13 @@
 				width: 300rpx;
 				margin-left: 25rpx;
 				.car_name{
-					max-height: 80rpx;
-					font-size: 30rpx;
-					line-height: 50rpx;
-					overflow: hidden;
+          max-height: 70rpx;
+          font-size: 30rpx;
+          line-height: 40rpx;
+          overflow: hidden;
+          white-space: nowrap; /* 不换行 */
+          overflow: hidden; /* 隐藏超出的内容 */
+          text-overflow: ellipsis; /* 用省略号表示被隐藏的部分 */
 				}
 				.car_spec{
 					color: #999999;
@@ -506,6 +542,14 @@
 					max-height: 60rpx;
 					overflow: hidden;
 				}
+        .promo_title{
+          max-height: 80rpx;
+          font-size: 20rpx;
+          line-height: 40rpx;
+          overflow: hidden;
+          padding: 0rpx 0rpx;
+          color: #dd524d;
+        }
 				.car_price{
 					font-size: 30rpx;
 					line-height: 60rpx;

+ 4 - 1
pages/index/index.vue

@@ -17,7 +17,10 @@
 				<!-- Vue3 项目部分小程序端事件延迟或调用失败 在执行事件的元素上添加 data-eventsync="true" 属性以解决此问题 -->
 				<view @click="toDetail(item)" data-eventsync="true" class="product_item" v-for="(item,index) in productList" :key="index" >
 					<image class="product_image" :src="item.thumb" mode=""></image>
-					<view class="product_name"><text class="regiment_title">{{item.regiment_title}}</text><text>{{item.name}}</text></view>
+					<view class="product_name">
+            <text v-if="item.promo_title" class="regiment_title">{{item.promo_title}}</text>
+            <text v-if="item.regiment_title" class="regiment_title">{{item.regiment_title}}</text>
+            <text>{{item.name}}</text></view>
 					<view class="product_spec"><text>{{item.spec}}</text></view>
 					<view class="stock_price">
 						<view class="product_price" v-if="isShowPrice">

+ 15 - 3
pages/product/index.vue

@@ -18,8 +18,11 @@
 					<text class="product_market">¥{{productInfo.market_price}} </text>
 				</view>
 			</view>
-			<view class="product_name"><text
-					class="regiment_title">{{productInfo.regiment_title}}</text>{{productInfo.name}}</view>
+			<view class="product_name">
+        <text v-if="productInfo.regiment_title" class="regiment_title">{{productInfo.regiment_title}}</text>
+        <text v-if="productInfo.promo_title" class="regiment_title">{{productInfo.promo_title}}</text>
+        {{productInfo.name}}
+      </view>
 			<view class="product_spec">
 				<view class="spec_name">{{productInfo.spec}}</view>
 				<view class="product_stock">剩{{productInfo.stock}}个</view>
@@ -128,6 +131,7 @@
 					</view>
 					<view class="box_right">
 						<view class="car_name">{{productInfo.name}}</view>
+            <view v-if="productInfo.promo_title" class="promo_title">{{productInfo.promo_title}}</view>
 						<view class="stock_price">
 							<view class="product_price" v-if="isShowPrice">
 								<text v-if="specBtnType==1">¥{{productInfo.price}} </text>
@@ -310,6 +314,7 @@
 					poster: "",
 					description: "",
 					regiment_title: '',
+          promo_title: '',
 					automatic_info: {
 						end_time: '',
 					},
@@ -1478,7 +1483,14 @@
 						overflow: hidden;
 						padding: 0rpx 0rpx;
 					}
-
+          .promo_title{
+            max-height: 80rpx;
+            font-size: 20rpx;
+            line-height: 40rpx;
+            overflow: hidden;
+            padding: 0rpx 0rpx;
+            color: #dd524d;
+          }
 					.car_spec {
 						color: #999999;
 						font-size: 24rpx;