sunny 2 سال پیش
والد
کامیت
b7f514ced0

+ 20 - 11
src/api/allApi.js

@@ -1,11 +1,11 @@
 import request from '@/utils/request'
 
 // 商品兑换列表
-export function integralList(data) {
+export function integralList(query) {
   return request({
     url: '/admin/mall-sku/integral/user/list',
-    method: 'post',
-    data
+    method: 'get',
+    data:query
   })
 }
 
@@ -23,14 +23,14 @@ export function festivalList(query) {
   return request({
     url: '/admin/mall-sku/festival/user/list',
     method: 'post',
-    data: query
+    params: query
   })
 }
 
 // 节日礼品详情
 export function festivalInfo(query) {
   return request({
-    url: '/admin/mall-sku/festival/info',
+    url: '/admin/mall-sku/festival/user/info',
     method: 'get',
     params: query
   })
@@ -44,7 +44,7 @@ export function notice(query) {
   })
 }
 
-//商品,节日礼品兑换
+//积分兑换
 export function start(query) {
   return request({
     url: '/admin/mall-order/start',
@@ -52,6 +52,15 @@ export function start(query) {
     data:query
   })
 }
+//福利券兑换
+export function kill(query) {
+  return request({
+    url: '/admin/mall-order/kill',
+    method: 'post',
+    data:query
+  })
+}
+
 
 //福利分类
 export function welfareType(data) {
@@ -72,21 +81,21 @@ export function welfareList(query) {
   })
 }
 //用户福利领取
-export function receiveWelfare(data) {
+export function receiveWelfare(query) {
   return request({
-    url: '/admin/mall-welfare/modify/status',
+    url: '/admin/mall-welfare/receive',
     method: 'post',
-    data
+    params:query
   })
 }
 
 
 //用户兑换列表
-export function orderList(data) {
+export function orderList(query) {
   return request({
     url: '/admin/mall-order/user/list',
     method: 'post',
-    data
+    params:query
   })
 }
 

+ 4 - 41
src/views/HomeView/GoodsDetail.vue

@@ -87,7 +87,7 @@
                         3、兑换成功后可在“成长福利-我的收获”查看
                     </p>
                 </div> -->
-        <div class="right">
+        <div class="right" v-if="data.orderType==1">
           <div class="remark-line">
             <span>备注:</span>
             <el-input
@@ -117,51 +117,14 @@ export default {
     return {
         orderId:this.$route.query.orderId,
         comment:'',
-        logs: [
-            {
-                "id": 0,
-                "orderId": 0,
-                "orderSeq": "",
-                "orderType": 0,
-                "auditor": "张三",
-                "comment": "成功下单",
-                "createTime": "2023-04-18 15:08:04",
-                "modifyTime": "2023-04-18 15:08:04",
-                "delFlag": 0,
-                "orderStatus": "商务部待确认"
-            }
-        ],
+        logs: [],
         skuCount: 1,
-        data: {
-            contact: '张三',
-            contactPhone: '13613885046',
-            contactEmaiL:'',
-            contactAddr: '正大西区CPL',
-            skuId: 19,
-            seq: "202304100004",
-            name: "保温杯",
-            skuType: 0,
-            productAttribute: 1,
-            productAttributeName: "实物",
-            location: "洛阳",
-            deliveryType: 0,
-            deliveryName: "无需快递",
-            price: 123,
-            imgUrl:
-            "https://p1-juejin.byteimg.com/tos-cn-i-k3u1fbpfcp/b186b6b25bb44c3b8ee6445432b4ddf5~tplv-k3u1fbpfcp-no-mark:0:0:0:0.image?",
-            status: 0,
-            statusName: "下架",
-            actualStock: 100,
-            lockStock: null,
-            stock: 1,
-            welfareVos: null,
-            creater: "admin123",
-        },
+        data: {},
     };
   },
   created() {
     const orderId = this.$route.query.orderId;
-    // this.getInfo(orderId);
+    this.getInfo(orderId);
   },
   methods: {
     getInfo(orderId) {

+ 29 - 18
src/views/HomeView/MyCenter.vue

@@ -68,6 +68,7 @@
                                             </div>
                                         </div>
                                         <div class="status bottom">
+                                            <span v-if="item.orderType==0">已兑换</span>
                                             <span v-if="item.orderType==1">待确认</span>
                                             <span v-if="item.orderType==2">作废</span>
                                             <span v-if="item.orderType==3">已确认</span>
@@ -171,6 +172,10 @@ export default {
                     value: 'all',
                     name: '全部',
                 },
+                {
+                    value: '0',
+                    name: '已兑换',
+                },
                 {
                     value: '1',
                     name: '待确认',
@@ -271,8 +276,8 @@ export default {
     },
     created() {
         
-        this.getList(this.activeName);
-        this.getNotice(this.activeName);
+        // this.getSecondList('1,2,3');
+        // this.getThirdList();
     },
     methods: {
         getFirstList(val){
@@ -284,8 +289,16 @@ export default {
             })
         },
         getThirdList(){
-            welfareList({status:'1.2'}).then(response=>{
-                this.thirdList = response.data.data;
+            welfareList({status:'1,2'}).then(response=>{
+                const dataList = response.data.data;
+                dataList.forEach(element => {
+                    element.imgUrl = element.relationWelfareVo.imgUrl;
+                    element.title = element.relationWelfareVo.title;
+                    element.startTime = element.relationWelfareVo.startTime;
+                    element.endTime = element.relationWelfareVo.endTime;
+                    element.welfareId = element.relationWelfareVo.welfareId;
+                });
+                this.thirdList = dataList;
             })
         },
         handleClickGoods(orderId) {
@@ -307,9 +320,9 @@ export default {
         },
         handleClickSecondTabs(val) {
             if(val=='all'){
-                val = '1,2,3'
+                val = '0,1,2,3'
             }
-            // this.getSecondList(val);
+            this.getSecondList(val);
         },
         getNotice(val) {
             notice({ noticeType: val }).then(response => {
@@ -338,20 +351,18 @@ export default {
         },
 
         handleClick(tab, event) {
+            console.log('111');
             console.log(tab.name, event);
             var name = tab.name;
-            // if(name=='first'){
-            //     this.getFirstList(val);
-            // }
-            // if(name=='second'){
-            //     this.getSecondList(val);
-            // }
-            // if(name=='third'){
-            //     this.getThirdList(val);
-            // }
-            
-            // this.getList(tab.name);
-            // this.getNotice(tab.name);
+            if(name=='first'){
+                this.getFirstList();
+            }
+            if(name=='second'){
+                this.getSecondList('0,1,2,3');
+            }
+            if(name=='third'){
+                this.getThirdList();
+            }
         },
         
     }

تفاوت فایلی نمایش داده نمی شود زیرا این فایل بسیار بزرگ است
+ 6 - 92
src/views/HomeView/PointsMall.vue


+ 93 - 64
src/views/HomeView/RedeemView.vue

@@ -36,40 +36,79 @@
                 
             </div>
             <p class="label">物品信息</p>
-            <table class="table">
-                <thead>
-                    <tr>
-                        <th width="35%">兑换物品</th>
-                        <th>数量</th>
-                        <th>单价</th>
-                        <th>兑换方式</th>
-                        <th>总计</th>
-                    </tr>
-                </thead>
-                <tbody>
-                    <tr>
-                        <td>
-                            <div class="prize-info">
-                                <div class="prize-img-container">
-                                    <el-image  class="lazy prize-img" :src="data.imgUrl" alt="prize" lazy></el-image>
+            <div v-if="activeName=='goodsNotice'">
+                <table class="table">
+                    <thead>
+                        <tr>
+                            <th width="35%">兑换物品</th>
+                            <th>数量</th>
+                            <th>单价</th>
+                            <th>兑换方式</th>
+                            <th>总计</th>
+                        </tr>
+                    </thead>
+                    <tbody>
+                        <tr>
+                            <td>
+                                <div class="prize-info">
+                                    <div class="prize-img-container">
+                                        <el-image  class="lazy prize-img" :src="data.imgUrl" alt="prize" lazy></el-image>
+                                    </div>
+                                    <div class="prize-detail-info">
+                                        <h3 class="title">{{ data.name }}</h3>
+                                        <p class="desc">
+                                            <span>{{ data.location }}</span>
+                                        </p>
+                                    </div>
                                 </div>
-                                <div class="prize-detail-info">
-                                    <h3 class="title">{{ data.name }}</h3>
-                                    <p class="desc">
-                                        <span>{{ data.location }}</span>
-                                    </p>
+                            </td>
+                            <td>{{ skuCount }}</td>
+                            <td>{{ data.price }} 积分</td>
+                            <td>{{ data.deliveryName }}</td>
+                            <td class="finlly-price">
+                                {{ data.price }} 积分
+                            </td>
+                        </tr>
+                    </tbody>
+                </table>
+            </div>
+            <div v-else>
+                <table class="table">
+                    <thead>
+                        <tr>
+                            <th width="35%">兑换物品</th>
+                            <th>数量</th>
+                            <th>消耗福利券</th>
+                            <th>物品属性</th>
+                            <th>兑换方式</th>
+                        </tr>
+                    </thead>
+                    <tbody>
+                        <tr>
+                            <td>
+                                <div class="prize-info">
+                                    <div class="prize-img-container">
+                                        <el-image  class="lazy prize-img" :src="data.imgUrl" alt="prize" lazy></el-image>
+                                    </div>
+                                    <div class="prize-detail-info">
+                                        <h3 class="title">{{ data.name }}</h3>
+                                        <p class="desc">
+                                            <span>{{ data.location }}</span>
+                                        </p>
+                                    </div>
                                 </div>
-                            </div>
-                        </td>
-                        <td>{{ skuCount }}</td>
-                        <td>{{ data.price }} 积分</td>
-                        <td>{{ data.deliveryName }}</td>
-                        <td class="finlly-price">
-                            {{ data.price }} 积分
-                        </td>
-                    </tr>
-                </tbody>
-            </table>
+                            </td>
+                            <td>{{ skuCount }}</td>
+                            <td>{{ data.title }}</td>
+                            <td>{{ data.productAttributeName }}</td>
+                            <td class="finlly-price">
+                                {{ data.deliveryName }}
+                            </td>
+                        </tr>
+                    </tbody>
+                </table>
+            </div>
+            
             <div class="footer">
                 <!-- <div class="left-info">
                     <span class="info-title">
@@ -145,7 +184,7 @@
     </div>
 </template>
 <script>
-import { integralInfo, festivalInfo, start } from "@/api/allApi";
+import { integralInfo, festivalInfo, start, kill } from "@/api/allApi";
 export default {
     data() {
         var validPhone = (rule, value, callback) => {
@@ -162,40 +201,22 @@ export default {
             }
         };
         return {
-            name: '张三',
-            phone: '13613885046',
-            email:'13613885046@qq.com',
-            address: '正大西区CPL',
+            activeName:this.$route.query.activeName,
+            name: '',
+            phone: '',
+            email:'',
+            address: '',
             disabled:true,
             skuCount:1,
-            data:{
-                "skuId": 19,
-                "seq": "202304100004",
-                "name": "保温杯",
-                "skuType": 0,
-                "productAttribute": 1,
-                "productAttributeName": "实物",
-                "location": "洛阳",
-                "deliveryType": 0,
-                "deliveryName": "无需快递",
-                "price": 123,
-                "imgUrl": "https://p1-juejin.byteimg.com/tos-cn-i-k3u1fbpfcp/b186b6b25bb44c3b8ee6445432b4ddf5~tplv-k3u1fbpfcp-no-mark:0:0:0:0.image?",
-                "status": 0,
-                "statusName": "下架",
-                "actualStock": 100,
-                "lockStock": null,
-                "stock": 1,
-                "welfareVos": null,
-                "creater": "admin123"
-            },
+            data:{},
             addressDetail:false,
             dialogFormVisible:false,
             dialogMsgVisible:false,
             dataForm: {
                 skuId:'',
-                name: '刘伟',
-                phone: '13683797487',
-                email:'13683797487@163.com',
+                name: '',
+                phone: '',
+                email:'',
                 address: '',
                 skuCount:1,
             },  
@@ -279,10 +300,18 @@ export default {
                 contactAddr:this.dataForm.address,
                 contactEmail:this.dataForm.email,
             }
-            start(params).then(response => {
-                console.log(response.data.data);
-                this.dialogMsgVisible = true;
-            }).catch(() => {})
+            if(this.activeName=='goodsNotice'){
+                start(params).then(response => {
+                    console.log(response.data.data);
+                    this.dialogMsgVisible = true;
+                }).catch(() => {})
+            }else{
+                kill(params).then(response => {
+                    console.log(response.data.data);
+                    this.dialogMsgVisible = true;
+                }).catch(() => {})
+            }
+            
         },
     }
 };

+ 6 - 39
src/views/HomeView/WelfareList.vue

@@ -16,7 +16,7 @@
                         </div>
                         <div class="btn-container">
                             <button v-if="item.status==9" class="ui-btn default medium btn">已过期</button>
-                            <button v-else @click="handleClickReceive(item.relationWelfareVo.welfareId)"
+                            <button v-else @click="handleClickReceive(item.id)"
                                 class="ui-btn primary medium btn">立即领取</button>
                         </div>
                     </div>
@@ -50,43 +50,10 @@ import { welfareList, receiveWelfare } from "@/api/allApi";
 export default {
     data() {
         return {
-            imgUrl: 'https://p1-juejin.byteimg.com/tos-cn-i-k3u1fbpfcp/b186b6b25bb44c3b8ee6445432b4ddf5~tplv-k3u1fbpfcp-no-mark:0:0:0:0.image?',
-            title:'中秋',
+            imgUrl: '',
+            title:'',
             dialogMsgVisible:false,
-            goodsList: [
-                {
-                    id: '1',
-                    imgUrl: 'https://p1-juejin.byteimg.com/tos-cn-i-k3u1fbpfcp/b186b6b25bb44c3b8ee6445432b4ddf5~tplv-k3u1fbpfcp-no-mark:0:0:0:0.image?',
-                    name: '苹果耳机AIRPOD',
-                    location: '洛阳',
-                    price: '700w',
-                    lockStock: '0',
-                },
-                {
-                    id: '2',
-                    imgUrl: 'https://p1-juejin.byteimg.com/tos-cn-i-k3u1fbpfcp/b186b6b25bb44c3b8ee6445432b4ddf5~tplv-k3u1fbpfcp-no-mark:0:0:0:0.image?',
-                    name: '苹果耳机AIRPOD',
-                    location: '洛阳',
-                    price: '700w',
-                    lockStock: '0',
-                },
-                {
-                    id: '3',
-                    imgUrl: 'https://p1-juejin.byteimg.com/tos-cn-i-k3u1fbpfcp/b186b6b25bb44c3b8ee6445432b4ddf5~tplv-k3u1fbpfcp-no-mark:0:0:0:0.image?',
-                    name: '苹果耳机AIRPOD',
-                    location: '洛阳',
-                    price: '700w',
-                    lockStock: '0',
-                },
-                {
-                    id: '4',
-                    imgUrl: 'https://p1-juejin.byteimg.com/tos-cn-i-k3u1fbpfcp/b186b6b25bb44c3b8ee6445432b4ddf5~tplv-k3u1fbpfcp-no-mark:0:0:0:0.image?',
-                    name: '苹果耳机AIRPOD',
-                    location: '洛阳',
-                    price: '700w',
-                    lockStock: '0',
-                }
-            ]
+            goodsList: []
         };
     },
     created() {
@@ -110,10 +77,10 @@ export default {
             })
         },
         handleClickReceive(id){
-            receiveWelfare({welfareId:id,status:1}).then(response => {
+            receiveWelfare({voucherId:id,status:1}).then(response => {
                 if(response.data.errno==0){
                     this.goodsList.forEach(element => {
-                        if(element.welfareId==id){
+                        if(element.id==id){
                             this.imgUrl = element.imgUrl;
                             this.title = element.title;
                         }