storeBelieveInLight hai 1 ano
pai
achega
75874bd91b

+ 3 - 0
commit/product.js

@@ -70,6 +70,9 @@ export function editSupplyChainPrice(id,data) {
70 70
      })
71 71
 }
72 72
 /**
73
+ * @description 供应链商品 -- 修改销售价
74
+ */
75
+/**
73 76
  * @description 供应链商品 -- 上下架
74 77
  */
75 78
 export function postchangeshow(data) {

+ 1 - 1
commit/requestPhp.js

@@ -13,7 +13,7 @@ export function myRequestPhp(options) {
13 13
 	let header = {
14 14
 		'Content-Type': 'application/json;charset=UTF-8',
15 15
 		// 'X-Token': 'eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJpc3MiOiJhcGkuaHh4ZmIuY29tIiwiYXVkIjoiYXBpLmh4eGZiLmNvbSIsImlhdCI6MTc0MDM3MTM1NSwibmJmIjoxNzQwMzcxMzU1LCJleHAiOjE3NTExNzEzNTUsImp0aSI6WzI5OCwibWVyIl19.j2f8VwdwWY4zBpcijHntzUZ9YUms2SxChaVsYf7KnPs',
16
-		"x-Token": uni.getStorageSync('phpToken'), //token
16
+		"X-Token": uni.getStorageSync('phpToken'), //token
17 17
 		// "X-Token": "eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJpc3MiOiJhcGkuaHh4ZmIuY29tIiwiYXVkIjoiYXBpLmh4eGZiLmNvbSIsImlhdCI6MTc0MDU3MTQ0OCwibmJmIjoxNzQwNTcxNDQ4LCJleHAiOjE3NTEzNzE0NDgsImp0aSI6WzM1NCwibWVyIl19.PVwYv71Gq9RxTxQclUoFMgc8cZt0ju3zQkxk6SGCQJw",
18 18
 		...options.header
19 19
 	}

+ 1 - 1
commit/user.js

@@ -15,7 +15,7 @@ const apiType = "php"
15 15
  * 
16 16
  * @returns 获取用户信息
17 17
  */
18
-export function getBaseInfo() {
18
+export function getBaseInfo(data) {
19 19
   return myRequestPhp({
20 20
          url: `${pre}mer/info`,
21 21
           method: 'GET',

+ 3 - 2
main.js

@@ -5,9 +5,9 @@ import Vue from 'vue'
5 5
 import time from '@/commit/item.js';
6 6
 import store from '@/store/index.js'
7 7
 import uView from '@/uni_modules/uview-ui';
8
-
8
+import Vconsole from "vconsole"
9 9
 // import VConsole from 'vconsole'
10
-// const vConsole = new VConsole();
10
+const vConsole = new Vconsole();
11 11
 // console.log('vConsole is running!');
12 12
 
13 13
 Vue.config.productionTip = false
@@ -15,6 +15,7 @@ Vue.prototype.$time = time
15 15
 Vue.prototype.$store = store 
16 16
 App.mpType = 'app'
17 17
 Vue.use(uView);
18
+
18 19
 const app = new Vue({
19 20
     ...App,
20 21
 	   store

+ 8 - 0
pages.json

@@ -60,6 +60,14 @@
60 60
 		  "enablePullDownRefresh": true
61 61
 	    }
62 62
 	  },
63
+        {
64
+	    "path": "pages/onlineproductselection/onlineDetail",
65
+	    "style": {
66
+	      // "navigationBarTitleText": "在线选品"
67
+	      "navigationStyle": "custom"//详情
68
+	    }
69
+	  },
70
+      
63 71
 	  {
64 72
 	    "path": "pages/supplychainon/supplychainon",
65 73
 	    "style": {

+ 49 - 0
pages/onlineproductselection/components/detail/DeliveryInfo.vue

@@ -0,0 +1,49 @@
1
+<template>
2
+  <view class="delivery-info">
3
+    <view class="delivery-item">
4
+      <view class="label">配送至</view>
5
+      <view class="value">{{ delivery.to }}</view>
6
+    </view>
7
+    <view class="delivery-item">
8
+      <view class="label">包邮</view>
9
+      <view class="value">{{ delivery.freeShipping }}</view>
10
+    </view>
11
+    <view class="delivery-item">
12
+      <view class="label">起购</view>
13
+      <view class="value">{{ delivery.minPurchase }}</view>
14
+    </view>
15
+  </view>
16
+</template>
17
+
18
+<script>
19
+export default {
20
+  props: {
21
+    delivery: {
22
+      type: Object,
23
+      required: true
24
+    }
25
+  }
26
+};
27
+</script>
28
+
29
+<style lang="scss" scoped>
30
+.delivery-info {
31
+  background-color: #ffffff;
32
+  border-radius: 10rpx;
33
+  box-shadow: 0 2rpx 4rpx rgba(0, 0, 0, 0.1);
34
+  padding: 30rpx;
35
+  margin-bottom: 30rpx;
36
+}
37
+.delivery-item {
38
+  margin-bottom: 15rpx;
39
+}
40
+.label {
41
+  font-size: 28rpx;
42
+  color: #666666;
43
+  margin-bottom: 8rpx;
44
+}
45
+.value {
46
+  font-size: 26rpx;
47
+  color: #333333;
48
+}
49
+</style>

+ 65 - 0
pages/onlineproductselection/components/detail/ProductInfo.vue

@@ -0,0 +1,65 @@
1
+<template>
2
+  <view class="product-info">
3
+    <view class="price-section">
4
+      <view class="price-item">
5
+        <view class="label">销售价</view>
6
+        <view class="value">¥{{ product.salePrice }}</view>
7
+      </view>
8
+      <view class="price-item">
9
+        <view class="label">创客利润</view>
10
+        <view class="value">¥{{ product.creatorProfit }}</view>
11
+      </view>
12
+      <view class="price-item">
13
+        <view class="label">养老金</view>
14
+        <view class="value">¥{{ product.pension }}</view>
15
+      </view>
16
+    </view>
17
+    <view class="brand-info">
18
+      <view class="label">品牌商</view>
19
+      <view class="value">{{ product.brand }}</view>
20
+    </view>
21
+  </view>
22
+</template>
23
+
24
+<script>
25
+export default {
26
+  props: {
27
+    product: {
28
+      type: Object,
29
+      required: true
30
+    }
31
+  }
32
+};
33
+</script>
34
+
35
+<style lang="scss" scoped>
36
+.product-info {
37
+  background-color: #ffffff;
38
+  border-radius: 10rpx;
39
+  box-shadow: 0 2rpx 4rpx rgba(0, 0, 0, 0.1);
40
+  padding: 30rpx;
41
+  margin-bottom: 30rpx;
42
+}
43
+.price-section {
44
+  display: flex;
45
+  flex-wrap: wrap;
46
+  justify-content: space-between;
47
+}
48
+.price-item {
49
+  width: 33%;
50
+  margin-bottom: 20rpx;
51
+}
52
+.label {
53
+  font-size: 24rpx;
54
+  color: #666666;
55
+  margin-bottom: 8rpx;
56
+}
57
+.value {
58
+  font-size: 32rpx;
59
+  color: #333333;
60
+  font-weight: 500;
61
+}
62
+.brand-info {
63
+  margin-top: 20rpx;
64
+}
65
+</style>

+ 40 - 0
pages/onlineproductselection/components/detail/ProductSpec.vue

@@ -0,0 +1,40 @@
1
+<template>
2
+  <view class="product-spec">
3
+    <view class="spec-header">
4
+      <view class="label">规格</view>
5
+    </view>
6
+    <view class="spec-value">{{ product.spec }}</view>
7
+  </view>
8
+</template>
9
+
10
+<script>
11
+export default {
12
+  props: {
13
+    product: {
14
+      type: Object,
15
+      required: true
16
+    }
17
+  }
18
+};
19
+</script>
20
+
21
+<style lang="scss" scoped>
22
+.product-spec {
23
+  background-color: #ffffff;
24
+  border-radius: 10rpx;
25
+  box-shadow: 0 2rpx 4rpx rgba(0, 0, 0, 0.1);
26
+  padding: 30rpx;
27
+  margin-bottom: 30rpx;
28
+}
29
+.spec-header {
30
+  margin-bottom: 15rpx;
31
+}
32
+.label {
33
+  font-size: 28rpx;
34
+  color: #666666;
35
+}
36
+.spec-value {
37
+  font-size: 30rpx;
38
+  color: #333333;
39
+}
40
+</style>

A diferenza do arquivo foi suprimida porque é demasiado grande
+ 32 - 0
pages/onlineproductselection/components/detail/RichTextDetail.vue


+ 124 - 0
pages/onlineproductselection/components/listCard/product-item.vue

@@ -0,0 +1,124 @@
1
+<!-- components/product-item.vue -->
2
+<template>
3
+  <view class="product-card">
4
+    <view class="product-header">
5
+      <text class="product-name">{{ product.name }}</text>
6
+      <text class="product-status" :class="statusClass">{{ product.status }}</text>
7
+    </view>
8
+
9
+    <view class="price-info">
10
+      <text class="price-label">销售价:</text>
11
+      <text class="price-value">¥{{ product.price.toFixed(2) }}</text>
12
+    </view>
13
+
14
+    <view class="profit-info">
15
+      <text class="profit-label">创客利润:</text>
16
+      <text class="profit-value">¥{{ product.profit.toFixed(2) }}</text>
17
+    </view>
18
+
19
+    <view class="action-buttons">
20
+      <button class="btn detail" @click="$emit('detail')">商品详情</button>
21
+      <button 
22
+        class="btn add" 
23
+        :class="{ added: product.inLibrary }"
24
+        @tap="$emit('add-to-library', product)"
25
+      >
26
+        {{ product.inLibrary ? '已加入' : '加入商品库' }}
27
+      </button>
28
+    </view>
29
+  </view>
30
+</template>
31
+<script>
32
+export default {
33
+    props: {
34
+        product: {
35
+            type: Object,
36
+            default: () => ({})
37
+        }
38
+    },
39
+    data(){
40
+        return {
41
+
42
+        }
43
+    }
44
+}
45
+</script>
46
+<style lang="scss" scoped>
47
+.product-card {
48
+  background: #fff;
49
+  border-radius: 16rpx;
50
+  padding: 24rpx;
51
+  margin-bottom: 20rpx;
52
+  box-shadow: 0 4rpx 12rpx rgba(0,0,0,0.08);
53
+
54
+  .product-header {
55
+    display: flex;
56
+    justify-content: space-between;
57
+    margin-bottom: 20rpx;
58
+  }
59
+
60
+  .product-name {
61
+    font-size: 28rpx;
62
+    color: #333;
63
+    font-weight: 500;
64
+  }
65
+
66
+  .product-status {
67
+    font-size: 24rpx;
68
+    &.normal {
69
+      color: #67C23A;
70
+    }
71
+  }
72
+
73
+  .price-info, .profit-info {
74
+    margin-bottom: 12rpx;
75
+    display: flex;
76
+    align-items: center;
77
+  }
78
+
79
+  .price-label, .profit-label {
80
+    font-size: 26rpx;
81
+    color: #666;
82
+  }
83
+
84
+  .price-value {
85
+    color: #F56C6C;
86
+    font-weight: bold;
87
+  }
88
+
89
+  .profit-value {
90
+    color: #E6A23C;
91
+    font-weight: bold;
92
+  }
93
+
94
+  .action-buttons {
95
+    display: flex;
96
+    gap: 20rpx;
97
+    margin-top: 24rpx;
98
+
99
+    .btn {
100
+      flex: 1;
101
+      height: 64rpx;
102
+      line-height: 64rpx;
103
+      border-radius: 32rpx;
104
+      font-size: 26rpx;
105
+      transition: all 0.3s;
106
+
107
+      &.detail {
108
+        background: #f8f8f8;
109
+        color: #666;
110
+      }
111
+
112
+      &.add {
113
+        background: linear-gradient(90deg, #409EFF, #79BBFF);
114
+        color: #fff;
115
+
116
+        &.added {
117
+          background: #e0e0e0;
118
+          color: #999;
119
+        }
120
+      }
121
+    }
122
+  }
123
+}
124
+</style>

A diferenza do arquivo foi suprimida porque é demasiado grande
+ 210 - 0
pages/onlineproductselection/onlineDetail.vue


+ 68 - 9
pages/onlineproductselection/onlineproductselection.vue

@@ -1,19 +1,78 @@
1 1
 <template>
2
-	<view>
3
-		在线选品模块
2
+  <view class="online-class-wrapper">
3
+    <view class="headers">
4
+      <headersVue
5
+        headerTitle="在线选品列表"
6
+        @headerJump="headerJump"
7
+      ></headersVue>
8
+	      <view class="headers-box">
9
+      <searchVue
10
+        placeholder="请输入商品名称"
11
+        @search="onHandleSearch"
12
+      ></searchVue>
13
+      <tablist
14
+        class="mt"
15
+        :category="category"
16
+        :curruntActive="curruntActive"
17
+        @tabs="tabsHandleClick"
18
+      ></tablist>
19
+    </view>
20
+    </view>
21
+	<view class="online-content">
22
+		<button @click="goJump">详情</button>
4 23
 	</view>
24
+  </view>
5 25
 </template>
6 26
 
7 27
 <script>
8
-	export default {
9
-		data() {
10
-			return {
11
-				
12
-			};
13
-		}
28
+import headersVue from "../../shop/components/headers/headers.vue";
29
+import searchVue from "../../shop/commodity/components/search/search.vue";
30
+export default {
31
+  components: {
32
+    headersVue,
33
+	searchVue
34
+  },
35
+  data() {
36
+    return {
37
+		   curruntActive: 0,
38
+      category: [],
39
+	};
40
+  },
41
+  methods:{
42
+	headerJump(){
43
+		uni.switchTab({ url: '/shop/productManagementModule/productManagement' })
44
+	},
45
+	goJump(){
46
+		console.log("fff")
47
+		uni.redirectTo({ url: './onlineDetail' })
48
+	},
49
+	onHandleSearch(val){
50
+
51
+	},
52
+	tabsHandleClick(){
53
+
14 54
 	}
55
+  }
56
+};
15 57
 </script>
58
+<style>
59
+page {
60
+  background-color: #f7f8fc;
61
+  height: 100%;
62
+}
63
+</style>
64
+<style lang="scss" scoped>
65
+.online-class-wrapper{
66
+	height: 100%;
67
+	.headers{
68
+		border: 2rpx solid red;
69
+		width: 100%;
70
+		height: 100rpx;
71
+		box-sizing: border-box;
16 72
 
17
-<style lang="scss">
73
+	}
74
+	.online-content{
18 75
 
76
+	}
77
+}
19 78
 </style>

+ 7 - 2
pages/supplychainon/ProductCard.vue

@@ -61,13 +61,18 @@
61 61
           >
62 62
         </view>
63 63
       </view>
64
-
64
+     <view class="meta-info">
65
+        <view class="meta-item">
66
+          <view  style="padding-right:10rpx;font-size:26rpx">活动:</view>
67
+          <text  :style="{color:data.seckill == 1?'#FF3C29':'#666666','font-size':'26rpx'}">{{data.seckill == 1?'秒杀':'无'}}</text>
68
+        </view>
69
+      </view>
65 70
       <!-- 操作按钮 -->
66 71
       <view class="action-bar">
67 72
         <button class="action-btn edit-price" @click="$emit('edit-price',data)">
68 73
           改价
69 74
         </button>
70
-        <button class="action-btn set-activity" @click="$emit('edit-activity',data)">
75
+        <button class="action-btn set-activity" @click="$emit('edit-activity',data)" v-if="!data.spec_type">
71 76
           活动
72 77
         </button>
73 78
       </view>

+ 162 - 66
pages/supplychainon/price-edit-modal.vue

@@ -2,99 +2,190 @@
2 2
   <view class="price-edit-modal">
3 3
     <!-- 遮罩层 -->
4 4
     <view class="mask" @tap="close"></view>
5
-    
5
+
6 6
     <!-- 弹窗内容 -->
7 7
     <view class="modal-content">
8 8
       <view class="modal-header">修改销售价</view>
9
-      
10
-      <!-- 商品类型选择 -->
11
-      <view class="goods-type">
12
-        <text class="label">商品类型:</text>
13
-        <radio-group @change="handleTypeChange">
14
-          <view v-for="item in goodsTypes" :key="item.value" class="radio-item">
15
-            <label>
16
-              <radio :value="item.value" :checked="currentType === item.value" color="#007AFF"/>
17
-              {{ item.label }}
18
-            </label>
9
+      <template v-for="(listItem, isd) in upList">
10
+       <view class="wparnkd-centent" :key="'sdfgdxf' + isd">
11
+         <!-- 商品类型选择 -->
12
+        <view class="goods-type" :key="'sdfgdf' + isd">
13
+          <text class="label">商品类型:</text>
14
+          <radio-group @change="handleTypeChange">
15
+            <view
16
+              v-for="(item, index) in goodsTypesData"
17
+              :key="item.value + '_index' + index"
18
+              class="radio-item"
19
+            >
20
+              <label>
21
+                <radio
22
+                  :value="String(item.value)"
23
+                  :checked="currentType === item.value"
24
+                  color="#007AFF"
25
+                />
26
+                {{ item.label }}
27
+              </label>
28
+            </view>
29
+          </radio-group>
30
+        </view>
31
+        <view v-if="uplength != 1 && uplength != 0" :key="'sdfgdttf' + isd">
32
+          <view style="padding-bottom: 10rpx">规格:</view>
33
+          <view style="color: #007aff">{{ listItem.detail.规格 }}</view>
34
+        </view>
35
+        <!-- 价格输入区域 -->
36
+        <view class="price-input" :key="'sdfotktmgdf' + isd">
37
+          <text class="tip"
38
+            >最低销售价格不能小于:{{ listItem.min_market_price }}</text
39
+          >
40
+          <view class="input-row">
41
+            <text>销售价:</text>
42
+            <input
43
+              type="number"
44
+              v-model="fuzupList[isd].price"
45
+              placeholder="请输入销售价"
46
+              @input="calculateProfit"
47
+            />
19 48
           </view>
20
-        </radio-group>
21
-      </view>
22
-
23
-      <!-- 价格输入区域 -->
24
-      <view class="price-input">
25
-        <text class="tip">最低销售价格不能小于:{{ minPrice }}</text>
26
-        <view class="input-row">
27
-          <text>销售价:</text>
28
-          <input 
29
-            type="number" 
30
-            v-model="currentPrice" 
31
-            placeholder="请输入销售价"
32
-            :min="minPrice"
33
-            @input="calculateProfit"
34
-          />
35 49
         </view>
36
-      </view>
37
-
38
-      <!-- 计算结果显示 -->
39
-      <view class="profit-display">
40
-        <view>养老金:{{ pensionFund.toFixed(2) }}</view>
41
-        <view>创客利润:{{ makerProfit.toFixed(2) }}</view>
42
-      </view>
43 50
 
51
+        <!-- 计算结果显示 -->
52
+        <view class="profit-display" :key="'sdkkf' + isd">
53
+          <view>销售价:{{ listItem.price || "0.00" }}</view>
54
+          <view>养老金:{{ listItem.gong_pension || "0.00" }}</view>
55
+          <view>创客利润:{{ listItem.plate_mer_profit || "0.00" }}</view>
56
+        </view>
57
+       </view>
58
+      </template>
44 59
       <button class="confirm-btn" @tap="handleConfirm">确定</button>
45 60
     </view>
46 61
   </view>
47 62
 </template>
48 63
 
49 64
 <script>
50
-import {getBaseInfo} from "@/commit/user.js"
65
+import { editSupplyChainPrice } from "@/commit/product.js";
51 66
 export default {
52 67
   props: {
53
-    minPrice: { type: Number, default: 8.75 },
54
-    originalPrice: { type: Number, required: true },
55
-    goodsType: { type: String, default: 1 }
68
+    productData: {
69
+      type: Object,
70
+      default: () => {},
71
+    },
72
+    merInfo: {
73
+      type: Object,
74
+      default: () => {},
75
+    },
56 76
   },
57 77
   data() {
58 78
     return {
59
-      currentPrice: this.originalPrice,
60
-      currentType: this.goodsType,
61
-      pensionFund: 0,
62
-      makerProfit: 1.75,
63
-      goodsTypes: [
64
-        { label: '普通商品', value: 1 },
65
-        { label: '会员商品', value: 8 },
66
-        { label: '高级会员商品', value: 10 },
67
-        { label: '合伙人商品', value: 14 },
68
-        { label: '股权商品', value: 15 },
69
-        { label: '合伙人+股权商品', value: 16 }
70
-      ]
71
-    }
79
+      currentPrice: "",
80
+      currentType: "",
81
+      goodsTypes: "", // 商品类型
82
+      productStyles: [
83
+        { value: "", label: "全部" },
84
+        { value: "0", label: "单规格" },
85
+        { value: "1", label: "多规格" },
86
+      ],
87
+      upList: [], //attrValue
88
+      uplength: 0, //attrValue.length
89
+      pnjen: "", //product_id
90
+      fuzupList: [], //attrValue
91
+    };
92
+  },
93
+  watch: {
94
+    productData: {
95
+      handler(val) {
96
+        this.getProductData(val);
97
+      },
98
+      deep: true,
99
+    },
100
+  },
101
+  mounted() {
102
+    this.getProductData(this.productData);
72 103
   },
73 104
   methods: {
74 105
     handleTypeChange(e) {
75
-      this.currentType = e.detail.value
106
+      this.currentType = e.detail.value;
76 107
       // 这里可以添加不同类型的价格计算逻辑
77 108
     },
78 109
     calculateProfit() {
79 110
       // 示例计算逻辑,实际根据业务需求修改
80
-      this.pensionFund = this.currentPrice * 0.05
81
-      this.makerProfit = this.currentPrice * 0.15
111
+      this.pensionFund = this.currentPrice * 0.05;
112
+      this.makerProfit = this.currentPrice * 0.15;
113
+    },
114
+    getProductData(val) {
115
+      const _this = this;
116
+      const ev = (val && val.attrValue) || [];
117
+      const en = val && val.product_id;
118
+      const etype = val && val.type;
119
+      _this.goodsTypes = etype;
120
+      _this.upList = JSON.parse(JSON.stringify([...ev]));
121
+      _this.fuzupList = JSON.parse(JSON.stringify([...ev]));
122
+      _this.pnjen = en;
123
+      _this.uplength = ev.length;
82 124
     },
83 125
     handleConfirm() {
84
-      if (this.currentPrice < this.minPrice) {
85
-        uni.showToast({ title: '价格不能低于最低价', icon: 'none' })
86
-        return
126
+      var reg =
127
+        /(^[1-9]([0-9]+)?(.[0-9]{1,2})?$)|(^(0){1}$)|(^[0-9].[0-9]([0-9])?$)/;
128
+      //单拿数据 组成新的数组
129
+      const skuArr = this.fuzupList.map((project) => ({
130
+        sku_id: project.gong_sku_id,
131
+        edit_price: project.price,
132
+      }));
133
+      let _this = this;
134
+      const isEmtyPrice = skuArr.some(
135
+        (item) =>
136
+          item.edit_price == "" ||
137
+          item.edit_price == null ||
138
+          item.edit_price == undefined
139
+      );
140
+      const isZQPrice = skuArr.some(
141
+        (item) => !reg.test(item.edit_price) || item.edit_price == 0
142
+      );
143
+      if (isEmtyPrice) {
144
+        uni.showToast({ title: "请输入金额", icon: "none" });
145
+        return;
146
+      }
147
+      if (isZQPrice) {
148
+        uni.showToast({ title: "请输入正确金额", icon: "none" });
149
+        return;
87 150
       }
88
-      this.$emit('confirm', {
89
-        price: Number(this.currentPrice),
90
-        type: this.currentType
91
-      })
151
+      editSupplyChainPrice(this.pnjen, {
152
+        skuArr: skuArr,
153
+        type: this.goodsTypes,
154
+      }).then(
155
+        (res) => {
156
+          if (res.data.status == 200) {
157
+            uni.showToast({ title: res.data.message, icon: "none" });
158
+            _this.$emit("confirm");
159
+          } else {
160
+            uni.showToast({ title: res.data.message, icon: "none" });
161
+          }
162
+        },
163
+        (fail) => {
164
+          uni.showToast({ title: res.data.message, icon: "none" });
165
+        }
166
+      );
92 167
     },
93 168
     close() {
94
-      this.$emit('close')
95
-    }
96
-  }
97
-}
169
+      this.$emit("close");
170
+    },
171
+  },
172
+  computed: {
173
+    goodsTypesData() {
174
+      if (this.merInfo && this.merInfo.mer_id == 324) {
175
+        return [
176
+          { label: "普通商品", value: 1 },
177
+          { label: "会员商品", value: 8 },
178
+          { label: "高级会员商品", value: 10 },
179
+          { label: "合伙人商品", value: 14 },
180
+          { label: "股权商品", value: 15 },
181
+          { label: "合伙人+股权商品", value: 16 },
182
+        ];
183
+      } else {
184
+        return [{ label: "普通商品", value: 1 }];
185
+      }
186
+    },
187
+  },
188
+};
98 189
 </script>
99 190
 
100 191
 <style scoped>
@@ -105,7 +196,7 @@ export default {
105 196
   left: 0;
106 197
   right: 0;
107 198
   bottom: 0;
108
-  background: rgba(0,0,0,0.5);
199
+  background: rgba(0, 0, 0, 0.5);
109 200
   z-index: 999;
110 201
 }
111 202
 
@@ -122,6 +213,11 @@ export default {
122 213
   z-index: 1000;
123 214
 }
124 215
 
216
+.wparnkd-centent{
217
+  max-height: 70vh;
218
+  overflow-y: auto;
219
+}
220
+
125 221
 .modal-header {
126 222
   font-size: 18px;
127 223
   font-weight: bold;
@@ -158,7 +254,7 @@ input {
158 254
 
159 255
 /* 按钮样式 */
160 256
 .confirm-btn {
161
-  background: #007AFF;
257
+  background: #007aff;
162 258
   color: white;
163 259
   margin-top: 30rpx;
164 260
   border-radius: 8rpx;

+ 277 - 9
pages/supplychainon/supplychainon.vue

@@ -22,6 +22,7 @@
22 22
           :data="item"
23 23
           @status-change="handleStatusChange"
24 24
           @edit-price="handleEditPrice"
25
+          @edit-activity="handleEditActivity"
25 26
         />
26 27
       </template>
27 28
       <template v-else>
@@ -35,7 +36,77 @@
35 36
         —— 已经到最底部了哦 ——
36 37
       </view>
37 38
     </view>
38
-    <priceEditModal v-if="isshow" @close="isshow=false"/>
39
+    <priceEditModal
40
+      v-if="isshow"
41
+      :product-data="productObjData"
42
+      :merInfo="merInfo"
43
+      @close="priceEditModalClose"
44
+      @confirm="confirm"
45
+    />
46
+    <!-- 弹窗主体 -->
47
+    <uni-popup
48
+      ref="popup"
49
+      type="center"
50
+      :is-mask-click="false"
51
+      background-color="#rgba(0,0,0,0.5)"
52
+    >
53
+      <view class="popup-container" :class="[isOpen ? 'popup-show' : '']">
54
+        <!-- 标题区 -->
55
+        <view class="popup-header">
56
+          <text class="title">活动设置</text>
57
+        </view>
58
+        <!-- 内容区 -->
59
+        <view class="content-wrapper-popup">
60
+          <view class="form-item">
61
+            <uni-data-checkbox
62
+              mode="button"
63
+              icon="left"
64
+              v-model="formData.radio"
65
+              :localdata="rangeData"
66
+            ></uni-data-checkbox>
67
+          </view>
68
+          <!-- 秒杀区块 -->
69
+          <view class="form-item">
70
+            <uni-data-checkbox
71
+              mode="button"
72
+              icon="left"
73
+              v-model="formData.radios"
74
+              :localdata="rangeData1"
75
+              @change="onSwitchChange"
76
+            ></uni-data-checkbox>
77
+          </view>
78
+
79
+          <!-- 价格输入 -->
80
+          <view class="form-item">
81
+            <view class="item-label">秒杀价格</view>
82
+            <uni-easyinput
83
+              v-model="formData.seckill_price"
84
+              :errorMessage="isEmpty"
85
+              focus
86
+              placeholder="输入价格"
87
+              :adjust-position="false"
88
+              @change="changeInput"
89
+              type="digit"
90
+            ></uni-easyinput>
91
+          </view>
92
+          <!-- 时间选择 -->
93
+          <view class="form-item">
94
+            <view class="item-label">时间设置</view>
95
+            <uni-datetime-picker
96
+              type="datetime"
97
+              v-model="formData.seckill_date"
98
+              @change="onDateChange"
99
+            />
100
+          </view>
101
+        </view>
102
+
103
+        <!-- 操作按钮 -->
104
+        <view class="action-btns">
105
+          <button class="btn prev-step" @click="closePopup">取消</button>
106
+          <button class="btn submit-btn" @click="handleSubmit">提交</button>
107
+        </view>
108
+      </view>
109
+    </uni-popup>
39 110
   </view>
40 111
 </template>
41 112
 
@@ -45,12 +116,14 @@ import searchVue from "./search/search.vue";
45 116
 import tablist from "./tablist.vue";
46 117
 import ProductCard from "./ProductCard.vue";
47 118
 import emptyDataVue from "../../shop/components/emptyData/emptyData.vue";
48
-import priceEditModal from './price-edit-modal.vue'
119
+import priceEditModal from "./price-edit-modal.vue";
49 120
 import {
50 121
   getSupplyChainList,
51 122
   getSupplyChainTab,
52 123
   postchangeshow,
124
+  Addseckill, //活动
53 125
 } from "@/commit/product.js";
126
+import { getBaseInfo } from "@/commit/user.js";
54 127
 export default {
55 128
   components: {
56 129
     headerCom,
@@ -58,7 +131,7 @@ export default {
58 131
     tablist,
59 132
     ProductCard,
60 133
     emptyDataVue,
61
-    priceEditModal
134
+    priceEditModal,
62 135
   },
63 136
   data() {
64 137
     return {
@@ -72,7 +145,24 @@ export default {
72 145
       curruntActive: 0,
73 146
       category: [],
74 147
       type: 1,
75
-      isshow:false
148
+      isshow: false,
149
+      formData: {
150
+        radio: "1",
151
+        radios: "1",
152
+        seckill_price: "",
153
+        seckill_date: "",
154
+        product_id: "",
155
+      },
156
+      isOpen: false,
157
+      rangeData: [
158
+        { value: "1", text: "大仓活动" },
159
+        { value: "2", text: "平台活动" },
160
+      ],
161
+      rangeData1: [{ value: "1", text: "秒杀" }],
162
+      isEmpty: false,
163
+      dataObj: {},
164
+      productObjData: {},
165
+      merInfo: {},
76 166
     };
77 167
   },
78 168
   async onLoad(options) {
@@ -99,6 +189,27 @@ export default {
99 189
     }
100 190
   },
101 191
   methods: {
192
+    getBaseInfoData() {
193
+      getBaseInfo()
194
+        .then((res) => {
195
+          if (res.data.status === 200) {
196
+            // console.log(res.data.data)
197
+            this.merInfo = res.data.data || {};
198
+          } else {
199
+            this.merInfo = {};
200
+          }
201
+        })
202
+        .catch((err) => {
203
+          uni.showToast({
204
+            title: res.data.message || "获取失败",
205
+            mask: true,
206
+          });
207
+        });
208
+    },
209
+    async initData() {
210
+      await this.getSupplyChainTabData();
211
+      await this.getSupplyChainListData();
212
+    },
102 213
     async tabsHandleClick({ index, item }) {
103 214
       this.indexs = index;
104 215
       this.curruntActive = index;
@@ -106,7 +217,7 @@ export default {
106 217
       this.type = item.type || 1;
107 218
       this.page = 1;
108 219
       this.is_panudn = true;
109
-       uni.pageScrollTo({ scrollTop: 0, duration: 0 });
220
+      uni.pageScrollTo({ scrollTop: 0, duration: 0 });
110 221
       await this.getSupplyChainListData();
111 222
     },
112 223
     async getSupplyChainTabData() {
@@ -178,10 +289,104 @@ export default {
178 289
           uni.hideToast();
179 290
         });
180 291
     },
181
-   handleEditPrice(data){
182
-    //  this.productData = data;
183
-     this.isshow = true;
184
-   }
292
+    handleEditPrice(data) {
293
+      this.productObjData = data;
294
+      this.isshow = true;
295
+      document.body.style.overflow = "hidden";
296
+      this.getBaseInfoData();
297
+    },
298
+    priceEditModalClose() {
299
+      this.isshow = false;
300
+       document.body.style.overflow = "visible";
301
+    },
302
+    confirm() {
303
+      this.isshow = false;
304
+      this.initData();
305
+    },
306
+    handleEditActivity(data) {
307
+      this.dataObj = data;
308
+      this.isEmpty = false;
309
+      this.showPopup();
310
+    },
311
+    showPopup() {
312
+      this.isOpen = true;
313
+      this.$refs.popup.open();
314
+    },
315
+    closePopup() {
316
+      this.isOpen = false;
317
+      this.formData.radio = "1";
318
+      this.formData.radios = "1";
319
+      this.formData.seckill_price = "";
320
+      this.formData.seckill_date = "";
321
+      this.$refs.popup.close();
322
+    },
323
+    onDateChange(data) {
324
+      this.formData.seckill_date = data;
325
+    },
326
+    convertToISOString(dateStr) {
327
+      // 将输入的日期时间字符串中的空格替换为 'T',以符合 ISO 8601 格式
328
+      const isoFormatStr = dateStr.replace(" ", "T");
329
+      // 创建 Date 对象
330
+      const date = new Date(isoFormatStr);
331
+      // 将 Date 对象转换为 ISO 8601 格式的字符串
332
+      return date.toISOString();
333
+    },
334
+    async handleSubmit() {
335
+      // 提交逻辑
336
+      this.formData.product_id = this.dataObj.product_id;
337
+      let params = JSON.parse(JSON.stringify(this.formData));
338
+
339
+      if (
340
+        params.seckill_price == "" ||
341
+        params.seckill_price == null ||
342
+        params.seckill_price == undefined
343
+      ) {
344
+        uni.showToast({
345
+          title: "请输入秒杀价格",
346
+          icon: "none",
347
+        });
348
+        this.isEmpty = true;
349
+        return;
350
+      }
351
+      if (
352
+        params.seckill_date == "" ||
353
+        params.seckill_date == null ||
354
+        params.seckill_date == undefined
355
+      ) {
356
+        uni.showToast({
357
+          title: "请选择秒杀时间",
358
+          icon: "none",
359
+        });
360
+        return;
361
+      }
362
+      params.seckill_date = this.convertToISOString(params.seckill_date);
363
+
364
+      this.isEmpty = false;
365
+      uni.showLoading({
366
+        title: "秒杀活动添加中",
367
+      });
368
+      console.log(params);
369
+      try {
370
+        const res = await Addseckill(params);
371
+        if (res.data.status == 200) {
372
+          uni.showToast({
373
+            title: "秒杀活动添加成功",
374
+            icon: "none",
375
+          });
376
+          this.closePopup();
377
+          this.initData();
378
+        }
379
+      } catch (error) {
380
+      } finally {
381
+        uni.hideLoading();
382
+        uni.hideToast();
383
+      }
384
+    },
385
+    changeInput(val) {
386
+      if (val) {
387
+        this.isEmpty = false;
388
+      }
389
+    },
185 390
   },
186 391
 };
187 392
 </script>
@@ -216,4 +421,67 @@ page {
216 421
 .mrb {
217 422
   margin-bottom: 26rpx;
218 423
 }
424
+.popup-container {
425
+  width: 80vw;
426
+  background: #ffffff;
427
+  border-radius: 16rpx;
428
+  transition: all 0.3s ease;
429
+  transform: scale(0.8);
430
+  opacity: 0;
431
+  padding: 20rpx;
432
+  .popup-header {
433
+    padding: 0rpx 15rpx 15rpx;
434
+    border-bottom: 1px solid #eee;
435
+    .title {
436
+      font-size: 36rpx;
437
+      font-weight: 600;
438
+      color: #333;
439
+      text-align: center;
440
+    }
441
+  }
442
+}
443
+.content-wrapper-popup {
444
+  overflow: auto;
445
+  .form-item {
446
+    padding: 15rpx 0;
447
+    .item-label {
448
+      font-size: 28rpx;
449
+      font-weight: 600;
450
+      color: #333;
451
+      margin-bottom: 12rpx;
452
+    }
453
+  }
454
+}
455
+.popup-show {
456
+  transform: scale(1);
457
+  opacity: 1;
458
+}
459
+.action-btns {
460
+  display: flex;
461
+  padding: 24rpx;
462
+  gap: 20rpx;
463
+  border-top: 1px solid #eee;
464
+
465
+  .btn {
466
+    flex: 1;
467
+    height: 80rpx;
468
+    line-height: 80rpx;
469
+    border-radius: 8rpx;
470
+    font-size: 28rpx;
471
+
472
+    &.prev-step {
473
+      background: #f8f8f8;
474
+      color: #666;
475
+    }
476
+
477
+    &.submit-btn {
478
+      background: #007aff;
479
+      color: white;
480
+    }
481
+  }
482
+}
483
+
484
+/deep/.uni-popup {
485
+  z-index: 667;
486
+}
219 487
 </style>

+ 1 - 1
shop/productManagementModule/components/productEvaluation/ReplyModal.vue

@@ -18,7 +18,7 @@
18 18
       </view>
19 19
       <view class="reply-modal">
20 20
         <textarea
21
-          adjust-position="false"
21
+          :adjust-position="false"
22 22
           v-model="replyContent"
23 23
           placeholder="输入回复内容"
24 24
           :maxlength="-1"

+ 10 - 4
shop/productManagementModule/index.vue

@@ -16,7 +16,6 @@
16 16
         :cardData="onlineData"
17 17
         @custom-handle-click="onGongyingliang"
18 18
       ></listCardInfo>
19
-      <!-- <listCardInfo headerTitle="在线选品" class="mb-t1"></listCardInfo> -->
20 19
       <!-- <listCardInfo headerTitle="商品分类" class="mb-t1" :fullSreen="true" fullSreenTitle="商品分类列表" ></listCardInfo> -->
21 20
       <!-- <listCardInfo headerTitle="商品规格" class="mb-t1" :fullSreen="true" fullSreenTitle="商品规格列表"></listCardInfo> -->
22 21
       <listCardInfo
@@ -26,9 +25,11 @@
26 25
         fullSreenTitle="商品评价列表"
27 26
         @custom-handle-click="onHandlePingJia"
28 27
       ></listCardInfo>
29
-      <!-- <listCardInfo headerTitle="在线选品" class="mb-t1"></listCardInfo> -->
30
-      <!-- <listCardInfo headerTitle="在线选品" class="mb-t1"></listCardInfo> -->
31
-      <!-- <listCardInfo headerTitle="在线选品" class="mb-t1"></listCardInfo> -->
28
+      <listCardInfo
29
+       headerTitle="在线选品"
30
+       class="mb-t1" 
31
+      :fullSreen="true"
32
+        fullSreenTitle="在线选品列表"  @custom-handle-click="onHandleXuanPin"></listCardInfo>
32 33
     </view>
33 34
   </view>
34 35
 </template>
@@ -299,6 +300,11 @@ export default {
299 300
           return;
300 301
         }
301 302
     },
303
+    onHandleXuanPin(){
304
+      uni.redirectTo({
305
+        url:"/pages/onlineproductselection/onlineproductselection"
306
+      })
307
+    },
302 308
     // jinru(n, p) {
303 309
     //   let name = p;
304 310
     //   let page = n;