Selaa lähdekoodia

Merge branch 'feature/mockApi' of http://face3d.4dage.com:7005/zhangyupeng/zfb_mp into feature/mockApi

tangning 3 vuotta sitten
vanhempi
commit
aa195955d7

+ 1 - 0
src/api/scene/live.ts

@@ -9,6 +9,7 @@ enum Api {
   brandTypeList = '/basic-api/brand/brandTypeList',
   brandTypeList = '/basic-api/brand/brandTypeList',
   // bindUser = '/zfb-api/zfb/shop/sys/brand/bindUser',
   // bindUser = '/zfb-api/zfb/shop/sys/brand/bindUser',
   bindUser = '/basic-api/brand/bindUser',
   bindUser = '/basic-api/brand/bindUser',
+  brandUpdate = '/basic-api/brand/update',
 }
 }
 export type SceneLiveItemResult = SceneLiveItem;
 export type SceneLiveItemResult = SceneLiveItem;
 /**
 /**

+ 1 - 0
src/locales/lang/zh-CN/routes/scenes.ts

@@ -23,6 +23,7 @@ export default {
   canShow: '是否同时开通一起逛',
   canShow: '是否同时开通一起逛',
   bindTime: '绑定时间',
   bindTime: '绑定时间',
   anchorList: '主播列表',
   anchorList: '主播列表',
+  addLive: '新增场景',
   roleType: {
   roleType: {
     0: '公司管理员',
     0: '公司管理员',
     1: '公司员工',
     1: '公司员工',

+ 100 - 0
src/views/scenes/addLiveModal.vue

@@ -0,0 +1,100 @@
+<template>
+  <BasicModal
+    v-bind="$attrs"
+    @register="register"
+    :title="t('routes.scenes.addLive')"
+    @ok="handleSubmit"
+  >
+    <div class="pt-20px">
+      <BasicForm @register="registerForm">
+        <!-- <template #label="{ model, field }">
+          {{ model[field] }}
+        </template>
+        <template #process> {{ downloadInfo.process }} % </template>
+        <template #status> {{ downloadInfo.status }} </template> -->
+      </BasicForm>
+    </div>
+    <template #centerFooter> </template>
+  </BasicModal>
+</template>
+<script lang="ts">
+  import { defineComponent, ref } from 'vue';
+  import { BasicModal, useModalInner } from '/@/components/Modal';
+  import { BasicForm, FormSchema, useForm } from '/@/components/Form/index';
+  // import { BasicTable, useTable, BasicColumn, FormSchema } from '/@/components/Table';
+  // import { useMessage } from '/@/hooks/web/useMessage';
+  // import { checkUserAddAble } from '/@/api/corporation/modal';
+  import { useI18n } from '/@/hooks/web/useI18n';
+  import { brandTypeListApi } from '/@/api/scene/live';
+  // import { bindAnchorListParam } from '/@/api/scene/model';
+  // import { Time } from '/@/components/Time';
+  // import { useUserStore } from '/@/store/modules/user';
+  const { t } = useI18n();
+  const schemas: FormSchema[] = [
+    {
+      field: 'type',
+      label: t('common.type'),
+      component: 'ApiSelect',
+      colProps: {
+        xl: 5,
+        xxl: 5,
+      },
+      componentProps: {
+        api: brandTypeListApi,
+        resultField: 'list',
+        labelField: 'name',
+        valueField: 'id',
+        params: {
+          page: 1,
+          limit: 1000,
+        },
+      },
+    },
+  ];
+
+  export default defineComponent({
+    components: { BasicModal, BasicForm },
+    props: {
+      userData: { type: Object },
+    },
+    emits: ['register', 'success'],
+    setup() {
+      // const { createMessage } = useMessage();
+      const sceneNum = ref('');
+
+      const [registerForm, { setFieldsValue }] = useForm({
+        schemas: schemas,
+        labelWidth: 100,
+        showActionButtonGroup: false,
+
+        actionColOptions: {
+          span: 24,
+        },
+        // submitFunc: handleSubmit,
+      });
+      const [register, { closeModal }] = useModalInner((data) => {
+        data && onDataReceive(data);
+      });
+
+      function onDataReceive(data) {
+        console.log('Data Received', data, data.num);
+
+        setFieldsValue({
+          ...data,
+        });
+
+        sceneNum.value = data.num;
+      }
+      const handleSubmit = async () => {};
+
+      return {
+        t,
+        register,
+        schemas,
+        handleSubmit,
+        closeModal,
+        registerForm,
+      };
+    },
+  });
+</script>

+ 44 - 27
src/views/scenes/live.vue

@@ -1,10 +1,41 @@
+<!-- address: "浙江省,杭州市,萧山区 山阴路688号恒隆广场B座1217"
+adminId: null
+appListPicUrl: "https://4dkk.4dage.com/shop/huafa/20211206/150212290bc34b.jpg?x-oss-process=image/resize,m_fixed,w_400,h_400"
+bindShowerId: null
+bindShowerName: null
+bindShowerNameList: null
+city: null
+contractPhone: "15975119071"
+createTime: null
+createUserDeptId: 178
+createUserId: 266
+deleted: 0
+id: 1046768
+introduceVideo: null
+introduceVideoCover: null
+latitude: 30.178317
+liveRoomUrl: "https://zfb.4dkankan.com/shop.html?m=zfb-Vs6EY33Ql"
+livestreamStatus: 0
+longitude: 120.262421
+name: "eliaukd"
+picList: ""
+sceneNum: "zfb-Vs6EY33Ql"
+sceneUrl: "https://zfb.4dkankan.com/smobile.html?m=zfb-Vs6EY33Ql"
+shareWxQrCode: "https://houseoss.4dkankan.com/domain/shop/image/zfb-Vs6EY33Ql1638771871311_QRCode.png"
+simpleDesc: "eliauk"
+sortOrder: 101
+token: null
+type: 0
+updateTime: null
+updateUserDeptId: 178
+updateUserId: 427 -->
 <template>
 <template>
   <div class="p-4">
   <div class="p-4">
     <BasicTable @register="registerTable" :rowSelection="{ type: 'checkbox' }">
     <BasicTable @register="registerTable" :rowSelection="{ type: 'checkbox' }">
       <template #toolbar>
       <template #toolbar>
-        <a-button type="primary" @click="() => {}"> 新增</a-button>
-        <!-- <a-button type="primary" color="warning" @click="() => {}"> 编辑</a-button> -->
-        <!-- <a-button type="primary" color="error" @click="() => {}"> 删除</a-button> -->
+        <a-button type="primary" @click="handleLiveOpen"> 新增</a-button>
+        <a-button type="primary" color="warning" @click="() => {}"> 编辑</a-button>
+        <a-button type="primary" color="error" @click="() => {}"> 删除</a-button>
       </template>
       </template>
       <template #cover="{ record }">
       <template #cover="{ record }">
         <TableImg
         <TableImg
@@ -48,6 +79,7 @@
       </template>
       </template>
     </BasicTable>
     </BasicTable>
     <bindModal @register="registerBindModal" @success="reload" />
     <bindModal @register="registerBindModal" @success="reload" />
+    <addLiveModal @register="registeraddLiveModal" @success="reload" />
   </div>
   </div>
 </template>
 </template>
 <script lang="ts">
 <script lang="ts">
@@ -69,13 +101,15 @@
   import { useI18n } from '/@/hooks/web/useI18n';
   import { useI18n } from '/@/hooks/web/useI18n';
   import { useModal } from '/@/components/Modal';
   import { useModal } from '/@/components/Modal';
   import bindModal from './bindModal.vue';
   import bindModal from './bindModal.vue';
+  import addLiveModal from './addLiveModal.vue';
 
 
   export default defineComponent({
   export default defineComponent({
-    components: { BasicTable, TableAction, TableImg, bindModal },
+    components: { BasicTable, TableAction, TableImg, bindModal, addLiveModal },
     setup() {
     setup() {
       const { createMessage } = useMessage();
       const { createMessage } = useMessage();
       const { t } = useI18n();
       const { t } = useI18n();
       const [registerBindModal, { openModal: openBindModal }] = useModal();
       const [registerBindModal, { openModal: openBindModal }] = useModal();
+      const [registeraddLiveModal, { openModal: openLiveModal }] = useModal();
 
 
       const columns: BasicColumn[] = [
       const columns: BasicColumn[] = [
         {
         {
@@ -132,28 +166,6 @@
             return h(Tag, { color: color }, () => text);
             return h(Tag, { color: color }, () => text);
           },
           },
         },
         },
-        // {
-        //   title: '是否开播',
-        //   dataIndex: 'isSteam',
-        //   width: 180,
-        //   customRender: ({ record }) => {
-        //     if (!Reflect.has(record, 'pendingStatus')) {
-        //       record.pendingStatus = false;
-        //     }
-        //     return h(Switch, {
-        //       checked: record.isSteam,
-        //       checkedChildren: t('common.yes'),
-        //       unCheckedChildren: t('common.no'),
-        //       loading: false,
-        //       onChange(checked: boolean) {
-        //         record.pendingStatus = true;
-        //         const newStatus = checked ? '1' : '0';
-        //         const { createMessage } = useMessage();
-        //         createMessage.info(`暂未接入` + newStatus);
-        //       },
-        //     });
-        //   },
-        // },
 
 
         {
         {
           title: t('common.operation'),
           title: t('common.operation'),
@@ -269,7 +281,10 @@
         console.log('record', record);
         console.log('record', record);
         openBindModal(true, record);
         openBindModal(true, record);
       }
       }
-
+      function handleLiveOpen(record: Recordable) {
+        console.log('record', record);
+        openLiveModal(true, record);
+      }
       return {
       return {
         registerTable,
         registerTable,
         createMessage,
         createMessage,
@@ -279,6 +294,8 @@
         handleBindAnchor,
         handleBindAnchor,
 
 
         reload,
         reload,
+        registeraddLiveModal,
+        handleLiveOpen,
       };
       };
     },
     },
   });
   });