zory 1 semana atrás
pai
commit
fe90b534c2

+ 12 - 0
src/api/model/merOrder.js

@@ -0,0 +1,12 @@
+import config from "@/config";
+import http from "@/utils/request";
+
+export default {
+    list: {
+        url: `${config.API_URL}/merchant/order/list`,
+        name: "-",
+        get: async function (params) {
+            return await http.get(this.url, params);
+        },
+    },
+}

+ 6 - 1
src/components/chat/index.vue

@@ -49,6 +49,9 @@
 						<div v-else-if="item.type === 'order'" @click="onClick">
 							<m-order :isMy="isMy" :value="item"></m-order>
 						</div>
+						<div v-else-if="item.type === 'address'" @click="onClick">
+							<m-address :isMy="isMy" :value="item"></m-address>
+						</div>
 						<div v-else-if="item.type === 'pay'" @click="onClick">
 							<m-price :isMy="isMy" :value="item"></m-price>
 						</div>
@@ -104,6 +107,7 @@ import mShareSbcf from './m-share-sbcf.vue';
 import mShareMall from './m-share-mall.vue';
 import mOrder from './m-order.vue';
 import mPrice from './m-price.vue';
+import mAddress from './m-address.vue';
 
 import mFunctionalModule from './m-functional-module.vue';
 
@@ -123,7 +127,8 @@ export default {
 		mShareMall,
 		mFunctionalModule,
 		mOrder,
-		mPrice
+		mPrice,
+		mAddress
 	},
 	props: {
 		myid: {

+ 46 - 0
src/components/chat/m-address.vue

@@ -0,0 +1,46 @@
+<template>
+	<div>
+		<div class="m-order">
+			<div class="order-img"><el-image style="width: 60px;height: 60px;" :src="value.payload.address.img" fit="fit"></el-image></div>
+			<div class="order-info">
+				<div class="title">{{value.payload.address.name}}</div>
+				<div class="desc">{{value.payload.address.order}}</div>
+			</div>
+			<div class="status danger" v-if="value.payload.address.status==0">待补充</div>
+			<div class="status success" v-if="value.payload.address.status==1">已补充</div>
+		</div>
+	</div>
+</template>
+
+
+<script>
+export default {
+	props: {
+		isMy: {
+			type: [Boolean, Number],
+			default: false
+		},
+		value: {
+			type: Object,
+			default: {}
+		}
+	},
+	data() {
+		return {};
+	},
+}
+</script>
+
+<style>
+.m-order{background-color: #fff;border-radius: 5px;display: flex;font-size: 28upx;position: relative;}
+.m-order .order-img image{width: 60px;height: 60px;}
+.m-order .order-info {padding: 15upx;}
+.m-order .order-info .title{font-size: 14px;overflow: hidden;text-overflow: ellipsis;white-space: nowrap;}
+.m-order .order-info .price{font-size: 14px;color: #f00;}
+.m-order .status{position: absolute;right: 0;bottom: 0;border-radius: 5px 0 5px 0;background-color: #909399;font-size: 12px;color: #fff;padding: 5px;}
+.m-order .status.info{background-color: #909399;}
+.m-order .status.primary{background-color: #409eff;}
+.m-order .status.success{background-color: #67c23a;}
+.m-order .status.danger{background-color: #f56c6c;}
+.m-order .status.warn{background-color: #e6a23c;}
+</style>

+ 27 - 1
src/components/imFloat/imFloat.vue

@@ -35,6 +35,7 @@
                             <div class="desc" v-if="item.last.type=='image'">[图片消息]</div>
                             <div class="desc" v-if="item.last.type=='video'">[视频消息]</div>
                             <div class="desc" v-if="item.last.type=='pay'">[支付消息]</div>
+                            <div class="desc" v-if="item.last.type=='address'">[收集地址]</div>
                           </div>
                           <div class="time">
                             {{item.last.create_at}}
@@ -189,7 +190,7 @@
                                                 <div class="price">{{this.$TOOL.money(item.price)}}</div>
                                             </div>
                                             <div class="order-status-btn">
-                                                <div class="status primary cus" @click="sendOrder(item)">收集地址</div>
+                                                <div class="status primary cus" @click="sendAddress(item)">收集地址</div>
                                                 <div class="status info cus" @click="sendOrder(item)">发送</div>
                                                 <div class="status info" v-if="item.status=='0'">未支付</div>
                                                 <div class="status primary" v-if="item.status=='1'">待使用</div>
@@ -428,6 +429,23 @@ export default {
                 type: 'order'
             });
         },
+        /**
+         * 收集地址消息
+         * @param data 
+         */
+        async sendAddress(data){
+            var orderData = {"img":data.img,"name":"补充收货地址","order":data.out_order_no,"status":0};
+            var resp = await this.sendMessageApi("address",orderData);
+            if (!resp) {
+                return ;
+            }
+            this.sendMessageData({
+                payload: {
+                    address: orderData
+                },
+                type: 'address'
+            });
+        },
         async sendMessage(){
             if (!this.inputMessage) return ;
             var resp = await this.sendMessageApi("text",this.inputMessage);
@@ -526,6 +544,10 @@ export default {
 				var order = JSON.parse(item.content)
 				payload.pay = order
 			}
+			if (item.type == 'address') {
+				var order = JSON.parse(item.content)
+				payload.address = order
+			}
 			if (item.type == 'image') {
 				payload = {
 					contentType: 'image/png',
@@ -621,6 +643,10 @@ export default {
                         var order = JSON.parse(item.content)
                         payload.pay = order
                     }
+                    if (item.type == 'address') {
+                        var order = JSON.parse(item.content)
+                        payload.address = order
+                    }
                     if (item.type == 'image') {
                         payload = {
                             contentType: 'image/png',

+ 49 - 0
src/views/service/order/index/components/search.vue

@@ -0,0 +1,49 @@
+<template>
+    <fieldset>
+        <legend>
+            <el-tag type="info">条件筛选</el-tag>
+        </legend>
+        <el-form class="lv-form-inline" ref="searchForm" :model="searchKey" label-position="right" label-width="100px">
+            <div class="search-form">
+                <div class="form-left">
+                    <el-row :gutter="10">
+                        <el-col :xs="12" :sm="12" :md="12" :lg="6" :xl="4">
+                            <el-input v-model="searchKey.title" placeholder="商品标题" clearable :style="{ width: '100%' }" @keyup.enter="searchForm()">
+                                <template #prepend>商品标题</template>
+                            </el-input>
+                        </el-col>
+                        <el-col :xs="12" :sm="12" :md="12" :lg="6" :xl="4">
+                            <el-select v-model="searchKey.status" clearable placeholder="请选择状态" @change="searchForm" :style="{width: '100%'}" class="diy-select">
+                                <el-option value="1" label="正常"></el-option>
+                                <el-option value="2" label="禁用"></el-option>
+                                <template #prefix>状态</template>
+                            </el-select>
+                        </el-col>
+                        <el-col :xs="12" :sm="6" :md="6" :lg="6" :xl="4">
+                            <el-date-picker v-model="searchKey.create" :style="{width: '100%'}" placeholder="请选择创建时间" start-placeholder="开始时间" end-placeholder="结束时间" type="daterange" range-separator="至" @change="searchForm" />
+                        </el-col>
+                    </el-row>
+                </div>
+                <div class="form-line"></div>
+                <div class="form-right">
+                    <el-button type="primary" icon="el-icon-search" @click="searchForm">搜索</el-button>
+                </div>
+            </div>
+        </el-form>
+    </fieldset>
+</template>
+
+<script>
+export default {
+    data(){
+        return {
+            searchKey:{}
+        }
+    },
+    methods: {
+        searchForm(){
+            this.$emit("success",this.searchKey);
+        }
+    }
+}
+</script>

+ 89 - 0
src/views/service/order/index/components/table.vue

@@ -0,0 +1,89 @@
+<template>
+    <scTable ref="table" :apiObj="list.apiObj" :params="searchKey" @selectionChange="selectionChange" row-key="id">
+        <el-table-column type="selection" width="50" fixed="left"></el-table-column>
+        <el-table-column label="订单编号" width="260" fixed="left" prop="goods_id">
+            <template #default="scope">
+                <div class="order-name">
+                    <span>{{ scope.row.order_sn }}</span>
+                    <span class="dec">系统单号:{{ scope.row.out_order_no }}</span>
+                </div>
+            </template>
+        </el-table-column>
+        <el-table-column label="商品类型" prop="types" width="100">
+            <template #default="scope">
+                {{ scope.row.product?scope.row.product.types:'-' }}
+            </template>
+        </el-table-column>
+        <el-table-column label="商品信息" width="340" prop="name">
+            <template #default="scope">
+                <div class="goods-img">
+                    <div class="img">
+                        <el-image 
+                        style="width: 54px; height: 54px"
+                        :src="scope.row.img"
+                        :zoom-rate="1.2"
+                        :max-scale="7"
+                        :min-scale="0.2"
+                        :preview-src-list="[scope.row.img]"
+                        preview-teleported
+                        z-index="999"
+                        fit="cover"></el-image>
+                    </div>
+                    <div class="name">
+                        <span>{{ scope.row.product.product_name }}</span>
+                        <span class="dec">商品编码:{{ scope.row.product.product_id }}</span>
+                    </div>
+                </div>
+            </template>
+        </el-table-column>
+        <el-table-column label="商品售价" prop="types" width="120" align="right">
+            <template #default="scope">
+                <div class="order-name">
+                    <span>{{ scope.row.price?$TOOL.money(scope.row.price):'-' }}</span>
+                    <span class="dec">{{ scope.row.number }}份</span>
+                </div>
+            </template>
+        </el-table-column>
+        <el-table-column label="顾客支付" prop="types" width="120" align="right">
+            <template #default="scope">
+                {{ scope.row.pay_money?$TOOL.money(scope.row.pay_money):'-' }}
+            </template>
+        </el-table-column>
+        <el-table-column label="下单时间" prop="create_at" width="160" align="right"></el-table-column>
+    </scTable>
+</template>
+
+<script>
+export default {
+    data(){
+        return {
+            list: {
+                apiObj: this.$API.merOrder.list
+            },
+            dataSelect:[],
+            dataSelectFull:[],
+            searchKey:{}
+        }
+    },
+}
+</script>
+
+<style>
+.order-name span{display: block;}
+.order-name span.dec{color: #999;font-size: 12px;}
+.goods-img{display: flex;gap: 5px;}
+.goods-img .name span{display: block;}
+.goods-img .name span.dec{color: #999;font-size: 12px;}
+.goods-price,.price{display: flex;align-items: center;gap: 5px;font-size: 14px;}
+.goods-price .del{text-decoration: line-through;}
+.goods-price span{background-color: #fff !important;
+    border: 1px solid #d3d9e0 !important;
+    border-radius: 4px;
+    box-sizing: border-box;
+    color: #6c737a !important;
+    display: inline-flex;
+    flex: none;
+    font-size: 12px;
+    line-height: 18px !important;
+    padding: 1px 6px !important;text-decoration: none;}
+</style>

+ 45 - 1
src/views/service/order/index/index.vue

@@ -1,3 +1,47 @@
 <template>
+    <el-container class="flex-column">
+        <div class="table-search">
+            <search @success="handleSuccess"></search>
+            <!-- <optionBtn @success="handleSuccess" :dataSelect="dataSelect" :dataSelectFull="dataSelectFull" type="3"></optionBtn> -->
+        </div>
+        <el-main class="nopadding">
+            <div class="table-container">
+                <tablePage ref="tablePage" @success="tableHandle" @successFull="tableHandleFull" type="3"></tablePage>
+            </div>
+        </el-main>
+    </el-container>  
+</template>
 
-</template>
+<script>
+import search from './components/search';
+// import optionBtn from './components/option';
+import tablePage from './components/table';
+export default {
+    components: {
+        search,tablePage
+    },
+    data(){
+        return {
+            searchKey:{},
+            dataSelect:[],
+            dataSelectFull:[],
+        }
+    },
+    methods: {
+        tableHandle(data){
+            this.dataSelect = data;
+        },
+        tableHandleFull(data){
+            this.dataSelectFull = data;
+        },
+        handleSuccess(data){
+            this.$refs.tablePage.upData(data)
+        },
+        handleClick(name){
+            this.activeName = name;
+            this.searchKey.type = name;
+            this.$refs.tablePage.upData(this.searchKey)
+        }
+    }
+}
+</script>