소스 검색

'个人页完成'

周杰伦 4 년 전
부모
커밋
815ce9bf42

+ 1 - 0
operation-frontend/src/App.vue

@@ -11,6 +11,7 @@ import { domTitle, setDocumentTitle } from '@/utils/domUtil'
 import { i18nRender } from '@/locales'
 
 export default {
+
   data () {
     return {
     }

+ 8 - 0
operation-frontend/src/api/information.js

@@ -52,6 +52,14 @@ export function getMassDetail (msgId) {
     })
 }
 
+// 删除高级群发详情
+export function deleteMass (msgId) {
+    return request({
+        url: `/wxoperate/group/${msgId}`,
+        method: 'DELETE'
+    })
+}
+
 // 查询模板消息
 export function getTemplate (params) {
     return request({

+ 12 - 5
operation-frontend/src/components/DivEdit/index.vue

@@ -1,9 +1,10 @@
 <template>
+  <!--    @focus="handleKeyup" -->
   <div
     :id="editId"
     class="mt-edit"
     contenteditable="true"
-    @focus="handleKeyup"
+
     @click="handleClick"
     @keyup="handleKeyup"
     @input="getVal">
@@ -30,13 +31,18 @@
       },
       handleKeyup () {
         const divEdit = document.getElementById(this.editId)
+
         // 编辑框设置焦点
         divEdit.focus()
         this.setLastEditRange(divEdit)
       },
       setLastEditRange (divEdit) {
-        const selection = getSelection()
-        const currentGetRangeAt = selection.getRangeAt(0)
+         console.log('hello wrold')
+        const selection = window.getSelection && window.getSelection()
+              console.log('hello wrold')
+              console.log(selection.rangeCount)
+        const currentGetRangeAt = selection && selection.rangeCount > 0 && selection.getRangeAt(0)
+
         if (currentGetRangeAt.startOffset === 0 && this.lastEditRange.startOffset > 0) {
           window.getSelection().removeAllRanges()
           window.getSelection().addRange(this.lastEditRange)
@@ -47,6 +53,7 @@
       },
       /** 插入dom节点 */
       innerDom (innerStr) {
+        console.log(innerStr, 'innerStrinnerStrinnerStr')
         const divEdit = document.getElementById(this.editId)
         console.log(divEdit, 'divEditdivEdit')
         divEdit.focus()
@@ -59,14 +66,14 @@
         const hasR = range.createContextualFragment(innerStr)
         const hasRlastChild = hasR.lastChild
         range.insertNode(hasR)
-        // console.log(range,divEdit)
+        console.log(hasRlastChild, 'hasRlastChildhasRlastChild')
         if (hasRlastChild) {
           range.setStartAfter(hasRlastChild)
           range.collapse(true)
         }
         window.getSelection().removeAllRanges()
         window.getSelection().addRange(range)
-        divEdit.focus()
+        // divEdit.focus()
         this.getVal()
       },
       handleInner (innerStr) {

+ 1 - 1
operation-frontend/src/components/Model/index.vue

@@ -1,6 +1,6 @@
 <template>
   <a-modal
-    title="title"
+    :title="title"
     :visible="visible"
     :confirm-loading="confirmLoading"
     :footer="footer"

+ 4 - 4
operation-frontend/src/components/TemplateEdit/index.vue

@@ -46,16 +46,16 @@
           :add-status="addImageText"
         />
         <div class="operation-btn">
-          <a-button
+          <!-- <a-button
             v-if="list.length > 1"
             type="danger"
             class="add-image-text"
             @click="deleteOptionCard">
             删除该选项卡
-          </a-button>
-          <a-button type="primary" class="add-image-text" @click="addImageText = !addImageText">
+          </a-button> -->
+          <!-- <a-button type="primary" class="add-image-text" @click="addImageText = !addImageText">
             添加图文
-          </a-button>
+          </a-button> -->
         </div>
       </template>
 

+ 30 - 19
operation-frontend/src/components/TemplateItem/ImageTextItem.vue

@@ -55,7 +55,7 @@
           />
         </div>
       </div>
-      <div class="template-item" v-if="!hideDelete">
+      <!-- <div class="template-item" v-if="!hideDelete">
         <div class="label">
           操作:
         </div>
@@ -64,7 +64,7 @@
             删除该条
           </a-tag>
         </div>
-      </div>
+      </div> -->
     </div>
 
   </div>
@@ -112,7 +112,13 @@ export default {
     this.time = setTimeout(() => {
         if (this.itemData.hasOwnProperty('imagetextlist')) {
           if (!this.itemData.imagetextlist.length) { // 没有值
-            this.itemData.imagetextlist = []
+            this.itemData.imagetextlist = [{
+          picurl: '',
+          title: '',
+          media_id: '',
+          description: '', // 图文描述
+          url: ''
+        }]
             this.$forceUpdate()
           } else { // 有值
             this.$nextTick(_ => {
@@ -128,23 +134,22 @@ export default {
           }
         }
     }, 1000)
-
     this.$once('hook:beforeDestory', () => {
       clearTimeout(this.time)
     })
   },
   watch: {
-    addStatus: {
-      handler () {
-        if (this.itemData.imagetextlist.length < 8) {
-           const aa = this.itemData.imagetextlist.concat([JSON.parse(JSON.stringify(this.editContainer))])
-           this.$set(this.itemData, 'imagetextlist', aa)
-        } else {
-          this.$message.error('最多只能添加8条')
-        }
-           this.$forceUpdate()
-      }
-    }
+    // addStatus: {
+    //   handler () {
+    //     if (this.itemData.imagetextlist.length < 8) {
+    //        const aa = this.itemData.imagetextlist.concat([JSON.parse(JSON.stringify(this.editContainer))])
+    //        this.$set(this.itemData, 'imagetextlist', aa)
+    //     } else {
+    //       this.$message.error('最多只能添加8条')
+    //     }
+    //       this.$forceUpdate()
+    //   }
+    // }
   },
   data () {
       return {
@@ -185,16 +190,22 @@ export default {
      * index 编辑器的索引位置
      * */
     handleEditInnerDom ($dom, index) {
-      console.log(index, 'indexjindex')
+      console.log(index, $dom, 'indexjindex')
+      const editBox = this.$refs[`edit_${index}`][0]
+      console.log(editBox, 'editBox')
       if ($dom) {
         this.$nextTick(() => {
-          const editBox = this.$refs[`edit_${index}`][0]
           if (editBox) {
             editBox.innerDom($dom)
             this.$forceUpdate()
           }
         })
       }
+      // else { // 解决focus失焦问题
+      //     this.$nextTick(() => {
+      //      editBox.innerDom($dom)
+      //   })
+      // }
     }
   }
 }
@@ -210,8 +221,8 @@ export default {
 }
 
 /deep/ .ant-form {
-    border-bottom: 1px solid #d8d8d8;
-    margin-bottom: 20px;
+    // border-bottom: 1px solid #d8d8d8;
+    // margin-bottom: 20px;
 }
 
 .add-image-text {

+ 3 - 3
operation-frontend/src/layouts/UserLayout.vue

@@ -4,9 +4,9 @@
       <div class="top">
         <div class="header">
           <a @click="jumpGithub">
-            <img src="https://img-blog.csdnimg.cn/20201102164123661.jpg" class="logo" alt="logo">
-            <span class="title">serven-idiot</span>
-            <!--<span class="title">中德智慧-运营</span> -->
+            <!-- <img src="https://img-blog.csdnimg.cn/20201102164123661.jpg" class="logo" alt="logo">
+            <span class="title">serven-idiot</span> -->
+            <span class="title">中德智慧-运营</span>
           </a>
         </div>
         <div class="desc">

+ 2 - 2
operation-frontend/src/store/modules/account.js

@@ -5,7 +5,7 @@ import { setItem, getItem } from '@/utils/storage'
 const account = {
     namespaced: true,
     state: {
-        accountList: getItem('accountList') || 'hellol'
+        accountList: getItem('accountList') || 'hellol2222'
     },
 
     mutations: {
@@ -18,11 +18,11 @@ const account = {
     actions: {
       // 获取微信公众号列表
       getAccount ({ commit }) {
-          console.log('hello')
           return new Promise(async (resolve, reject) => {
             const { data, code } = await getAccount()
             if (code === 200) {
                 commit('SET_ACCOUNTLIST', data)
+                resolve()
             }
           })
       },

+ 1 - 1
operation-frontend/src/utils/request.js

@@ -71,8 +71,8 @@ request.interceptors.request.use(config => {
 }, errorHandler)
 
 // response interceptor
+
 request.interceptors.response.use((response) => {
-  console.log(response)
   if (response.headers.hasOwnProperty('auth_token')) {
     setItem('token', response.headers.auth_token)
   }

+ 0 - 4
operation-frontend/src/views/account/admin/index.vue

@@ -12,10 +12,6 @@
         </template>
         <span slot="action" slot-scope="text, record">
           <a @click="authOpration(record)"> {{ record.state ? '冻结' : '使用' }}</a>
-          <a-divider type="vertical" />
-          <a>Delete</a>
-          <a-divider type="vertical" />
-          <a class="ant-dropdown-link"> More actions <a-icon type="down" /> </a>
         </span>
       </a-table>
     </a-card>

+ 4 - 1
operation-frontend/src/views/fans/list.vue

@@ -161,10 +161,13 @@
     <a-modal v-model="fansVisable" >
       <template slot="title">
         {{ curFansInfo.nickName }}
+        <a-tag v-if="curFansInfo.sex === 2">未知性别</a-tag>
         <a-icon
+          v-else
           :style="{color: curFansInfo.sex === 1 ? 'rgb(24, 144, 255)' : '#eb2f96'}"
-          :type="curFansInfo.sex === 1 ? 'man' : 'woman'"
+          :type="curFansInfo.sex === 1 ? 'man' : 'woman' "
         />
+
         <!--
           -->
       </template>

+ 6 - 4
operation-frontend/src/views/information/mass/add.vue

@@ -236,18 +236,18 @@ export default {
         return item
       })
       this.content = [{ imagetextlist, type: this.massData.msgType }]
-      this.massData.media_id = item.media_id
+      this.massData.media_id = item.mediaId
     },
     // 选择视频
     changeVideo (item) {
       this.content = [{ ...item, type: this.massData.msgType }]
-      this.massData.media_id = item.media_id
+      this.massData.media_id = item.mediaId
     },
     // 选择音频
     changeAudit (item) {
       console.log(item, 'item')
       this.content = [{ ...item, type: this.massData.msgType }]
-      this.massData.media_id = item.media_id
+      this.massData.media_id = item.mediaId
     },
     // 确定文字
     changeText (item) {
@@ -257,6 +257,7 @@ export default {
     selectImg (item) {
       console.log(item)
       this.content = [{ ...item, type: this.massData.msgType }]
+      this.massData.media_id = item.mediaId
     },
     // 内容类型切换
     chooseType (value) {
@@ -274,12 +275,13 @@ export default {
                 const { msgType, type, selectTag, repeatSend, selectSubscribeTime, selectSex, ChangeCity: [selectProvince, selectCity] } = this.massData
 
                 let $content
-
+                console.log(this.content, 'this.contentthis.content')
                 if (msgType === 3) {
                   $content = JSON.stringify(repalceTag.dealListPost(JSON.parse(JSON.stringify(this.content))))
                 } else {
                   $content = JSON.stringify([{ media_id: this.massData.media_id }])
                 }
+                console.log($content, '$content$content')
 
                 const $par = {
                     accountId: this.accountId,

+ 18 - 3
operation-frontend/src/views/information/mass/index.vue

@@ -29,7 +29,14 @@
         <template slot="action" slot-scope="text, record">
           <a @click="headerQueryDetail(record)">详情</a>
           <a-divider type="vertical" />
-          <a>删除</a>
+          <a-popconfirm
+            title="确定要删除这条消息吗?"
+            ok-text="确定"
+            cancel-text="取消"
+            @confirm="deleteMass(record.id)"
+          >
+            <a>删除</a>
+          </a-popconfirm>
         </template>
       </a-table>
     </a-card>
@@ -42,7 +49,7 @@
 </template>
 
 <script>
-import { getMass } from '@/api/information'
+import { getMass, deleteMass } from '@/api/information'
 import { getMaterialDetail } from '@/api/material'
 import RangePicker from '@/components/RangePicker'
 import QueryType from '../components/QueryType'
@@ -221,7 +228,15 @@ export default {
         console.log(status)
         this.form.status = status
     },
-    //   查询客服消息模板
+    // 删除高级群发详情
+    async deleteMass (id) {
+      const { code } = await deleteMass(id)
+      if (code === 200) {
+          this.$message.scuuess('删除成功')
+          this.getMass()
+      }
+    },
+    // 查询客服消息模板
     async getMass () {
       this.loading = true
       const { data, code } = await getMass(this.form)

+ 2 - 2
operation-frontend/src/views/information/template/add.vue

@@ -97,7 +97,7 @@
                 <a-input
                   v-if="templateData.linkType === 0"
                   placeholder="非必填,输入跳转链接,且必须以http://或http://开头"
-                  v-decorator="['linkUrl', { rules: [{ required: true, message: '请填写跳转地址' }] }]"
+                  v-model="templateData.linkUrl"
                 />
                 <template v-else>
                   <a-input
@@ -338,7 +338,7 @@ export default {
       const { data, code } = await postTemplate($par)
       if (code === 200) {
           console.log(data)
-          this.$route.replace('/information/template')
+          this.$router.push('/information/template')
       }
     },
     // 查询模板消息详情

+ 3 - 1
operation-frontend/src/views/interaction/followReply/EditReply.vue

@@ -17,7 +17,7 @@
           </a-form-item>
           <a-form-item label="推送方式">
             <a-radio-group
-              v-decorator="['pushType', { rules: [{ required: true, message: '请选择二维码期限' }] }]"
+              v-decorator="['pushType', { rules: [{ required: true, message: '请选择推送方式' }] }]"
             >
               <a-radio :value="0">
                 全部推送
@@ -98,6 +98,8 @@ export default {
       const { data, code } = await putFollowReplyEnable($par)
       if (code === 200) {
         console.log(data)
+        this.$message.success('新增成功')
+        this.$router.push('/interaction/followReply')
       }
     },
 

+ 4 - 7
operation-frontend/src/views/interaction/push/EditPush.vue

@@ -190,11 +190,8 @@ export default {
       }
       this.form.validateFields((err, values) => {
         if (!err) {
-          const { pushType, pushLimit, pushTimer, pushTrigger, pushTimerType } = values
+          const { pushType, pushLimit, pushTrigger, pushTimerType } = values
           const { startTime: { timeString: startTime }, endTime: { timeString: endTime } } = this
-          console.log('Received values of form: ', values)
-          // this.putPush(pushType)
-          console.log(pushType, pushLimit, pushTimer, pushTrigger)
           const refers = ['a', 'b', 'c']
           const pushTriggerResult = []
           refers.forEach(refer => {
@@ -216,16 +213,16 @@ export default {
             content: JSON.stringify(resultContent),
             id: this.$route.query.id
           }
-          console.log($par)
           this.putPush($par)
         }
       })
     },
     // 发布二维码
     async putPush ($par) {
-      const { data, code } = await putPush($par)
+      const { code } = await putPush($par)
       if (code === 200) {
-        console.log(data)
+        this.$message.success('新增成功')
+        this.$router.push('/interaction/push')
       }
     },
 

+ 3 - 3
operation-frontend/src/views/interaction/qrcode/createQrcode.vue

@@ -94,6 +94,7 @@ export default {
           form: this.$form.createForm(this, { name: 'coordinated' }),
           createQrcodeData: {},
           accountId: '',
+          id: '',
           content: []
       }
   },
@@ -132,11 +133,11 @@ export default {
         return
       }
 
-      const { data, code } = await PostQrcode($par)
+      const { code } = await PostQrcode($par)
 
       if (code === 200) {
-        console.log(data)
         this.$message.success(`${this.id ? '修改' : '新增'} 成功`)
+        this.$router.push('/interaction/qrcode')
       }
     },
     changeContent (item) {
@@ -146,7 +147,6 @@ export default {
     async getQrcodeDetail () {
       const { data, code } = await getQrcodeDetail(this.id)
       if (code === 200) {
-          console.log(data)
           this.createQrcodeData = data
           this.content = JSON.parse(data.content)
           this.fillForm()

+ 1 - 0
operation-frontend/src/views/publicAccount/confirm.vue

@@ -63,6 +63,7 @@ export default {
         const { data, code } = await confirmAccount({ accountId: this.accountId })
         if (code === 200) {
             console.log(data)
+            await this.$store.dispatch('account/getAccount')
             this.black()
         }
      },

+ 6 - 8
operation-frontend/src/views/publicAccount/index.vue

@@ -14,7 +14,7 @@
           {{ record.nickName }}
         </span >
         <span slot="accType" slot-scope="text, record">
-          {{ record.serviceTypeInfo === 2? '服务号' : '订阅号' }}
+          {{ record.serviceTypeInfo.id === 2? '服务号' : '订阅号' }}
         </span >
         <span slot="verifyType" slot-scope="text, record">
           {{ record.verifyTypeInfo }}
@@ -35,7 +35,8 @@
 </template>
 
 <script>
-import { getAccount, deleteAccount, getAccountPreAuth } from '@/api/publicAccount'
+// getAccount,
+import { deleteAccount, getAccountPreAuth } from '@/api/publicAccount'
 const verifyTypeInfo = ['未认证', '微信认证', '新浪微博认证', '腾讯微博认证', '已资质认证通过但还未通过名称认证', '已资质认证通过、还未通过名称认证,但通过了新浪微博认证', '已资质认证通过、还未通过名称认证,但通过了腾讯微博认证']
 const columns = [
   {
@@ -105,15 +106,12 @@ export default {
     },
     // 查询公众号列表
     async getAccount () {
-      const { data, code } = await getAccount()
-      if (code === 200) {
-        console.log(data)
-        this.publicAccountData = data.map(item => {
+        await this.$store.dispatch('account/getAccount')
+        this.publicAccountData = this.$store.getters.account.map(item => {
           item.serviceTypeInfo = JSON.parse(item.serviceTypeInfo)
-          item.verifyTypeInfo = this.verifyTypeInfo[JSON.parse(item.verifyTypeInfo).id]
+          item.verifyTypeInfo = this.verifyTypeInfo[JSON.parse(item.verifyTypeInfo).id + 1]
           return item
         })
-      }
     }
   }
 }