提交 7741fea6 作者: 毛细亚

优化礼包发送功能与界面交互

上级 53bba110
...@@ -7,7 +7,8 @@ ...@@ -7,7 +7,8 @@
<div>礼包名称: {{ item.gift_package_name }}</div> <div>礼包名称: {{ item.gift_package_name }}</div>
<div>发送时间: {{ item.send_time }}</div> <div>发送时间: {{ item.send_time }}</div>
<div>礼包码: {{ item.code }}</div> <div>礼包码: {{ item.code }}</div>
<div>领取角色: {{ item.role_name }}({{ item.rule_id }})</div> <div>领取角色: <span v-if="item.role_name">{{ item.role_name }}({{ item.rule_id }})</span> <span v-else>-</span>
</div>
<div>W 账号: {{ item.username || '-' }}</div> <div>W 账号: {{ item.username || '-' }}</div>
<div class="rowFlex spaceBetween columnCenter gift-sender"> <div class="rowFlex spaceBetween columnCenter gift-sender">
<div>发送客服: {{ item.cser_name }}</div> <div>发送客服: {{ item.cser_name }}</div>
...@@ -23,7 +24,6 @@ ...@@ -23,7 +24,6 @@
</div> </div>
</div> </div>
</template> </template>
<script> <script>
import Clipboard from 'clipboard' import Clipboard from 'clipboard'
import { getSendingCodeList } from '@/api/works' import { getSendingCodeList } from '@/api/works'
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
* @Author: maoxiya 937667504@qq.com * @Author: maoxiya 937667504@qq.com
* @Date: 2025-08-28 15:59:46 * @Date: 2025-08-28 15:59:46
* @LastEditors: maoxiya 937667504@qq.com * @LastEditors: maoxiya 937667504@qq.com
* @LastEditTime: 2025-08-30 11:35:36 * @LastEditTime: 2025-08-30 18:43:01
* @FilePath: /company_wx_frontend/src/views/works/component/chat/giftCodeDialog.vue * @FilePath: /company_wx_frontend/src/views/works/component/chat/giftCodeDialog.vue
* @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE * @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
--> -->
......
...@@ -19,7 +19,7 @@ ...@@ -19,7 +19,7 @@
</div> </div>
<div class="rowFlex columnCenter spaceBetween gameCodeTitle" @click="showGameCode = !showGameCode"> <div class="rowFlex columnCenter spaceBetween gameCodeTitle" @click="showGameCode = !showGameCode">
<p class="rowFlex columnCenter spaceBetween"> <p class="rowFlex columnCenter spaceBetween">
<svg-icon icon-class="gift" style="font-size:25px;margin-right: 5px;margin-top: -2px;"></svg-icon> <svg-icon icon-class="gift" style="font-size:20px;margin-right: 5px;margin-top: -2px;"></svg-icon>
<span class="giftCode">礼包码</span> <span class="giftCode">礼包码</span>
</p> </p>
<i :class="showGameCode ? 'el-icon-arrow-right' : 'el-icon-arrow-down'"></i> <i :class="showGameCode ? 'el-icon-arrow-right' : 'el-icon-arrow-down'"></i>
...@@ -46,7 +46,7 @@ ...@@ -46,7 +46,7 @@
</el-popover> </el-popover>
</p> </p>
<el-button size="mini" type="primary" :loading="loading" <el-button size="mini" type="primary" :loading="loading"
@click="sendGameCode(items)">发送礼包码</el-button> @click="sendGameCodeCopyDialog(items)">发送礼包码</el-button>
</div> </div>
</div> </div>
</div> </div>
...@@ -58,7 +58,7 @@ ...@@ -58,7 +58,7 @@
</el-collapse> </el-collapse>
</el-collapse-transition> </el-collapse-transition>
</div> </div>
<giftCodeDialog ref="giftCodeDialog" :dialogVisible="dialogVisible" @result="getGiftCodeSubmit" /> <giftCodeDialog v-if="dialogVisible" :dialogVisible.sync="dialogVisible" @result="getGiftCodeSubmit" />
</div> </div>
</template> </template>
<script> <script>
...@@ -73,12 +73,32 @@ export default { ...@@ -73,12 +73,32 @@ export default {
disabled: true, disabled: true,
showGameCode: false, showGameCode: false,
giftCodeGame: [], giftCodeGame: [],
dialogVisible: false,
giftCodeForm: {
member_id: '',
username: '',
role_name: '',
role_id: '',
gift_package_id: '',
},
loading: false loading: false
} }
}, },
components: {
giftCodeDialog
},
mounted() { mounted() {
this.requestGiftCode() this.requestGiftCode()
}, },
destroyed() {
this.giftCodeForm = {
member_id: '',
username: '',
role_name: '',
role_id: '',
gift_package_id: ''
}
},
computed: { computed: {
...mapState('game', ['accountSelect', 'bindGameUserList', 'chatUserInfo']), ...mapState('game', ['accountSelect', 'bindGameUserList', 'chatUserInfo']),
...mapState('user', ['userid']), ...mapState('user', ['userid']),
...@@ -96,6 +116,16 @@ export default { ...@@ -96,6 +116,16 @@ export default {
} }
}, },
methods: { methods: {
initGiftCodeForm() {
const username = this.bindGameUserList.find(item => item.member_id === this.accountSelect).username
this.giftCodeForm = {
member_id: this.accountSelect,
username: username,
role_name: '',
role_id: '',
gift_package_id: '',
}
},
sendVipGift() { sendVipGift() {
if (this.bindGameUserList.length > 0) { if (this.bindGameUserList.length > 0) {
createVipUrl({ member_id: this.accountSelect }).then(res => { createVipUrl({ member_id: this.accountSelect }).then(res => {
...@@ -109,6 +139,7 @@ export default { ...@@ -109,6 +139,7 @@ export default {
this.$message.warning('请先关联游戏账号') this.$message.warning('请先关联游戏账号')
} }
}, },
sendChatMessage(content, type) { sendChatMessage(content, type) {
let message = {} let message = {}
if (type == 'text') { if (type == 'text') {
...@@ -194,14 +225,35 @@ export default { ...@@ -194,14 +225,35 @@ export default {
item.group_name = item.gift_package_group_name item.group_name = item.gift_package_group_name
}) })
}, },
// 发送渠道 // 确定提交
getGiftCodeSubmit(form) {
const { member_id, role_id, username, role_name } = form
this.giftCodeForm.username = username
this.giftCodeForm.role_name = role_name
this.giftCodeForm.member_id = member_id
this.giftCodeForm.role_id = role_id
this.sendGameCode()
},
sendGameCodeCopyDialog(items) {
this.initGiftCodeForm()
this.giftCodeForm.gift_package_id = items.id
if (items.package_type == 3) {
this.dialogVisible = true
} else {
this.sendGameCode()
}
},
// 发送礼包码
async sendGameCode(items) { async sendGameCode(items) {
this.loading = true this.loading = true
const data = { const data = {
userid: this.chatUserInfo.userid, userid: this.chatUserInfo.userid,
external_userid: this.chatUserInfo.external_userid, external_userid: this.chatUserInfo.external_userid,
member_id: this.accountSelect, member_id: this.giftCodeForm.member_id,
gift_package_id: items.id, username: this.giftCodeForm.username,
role_name: this.giftCodeForm.role_name,
role_id: this.giftCodeForm.role_id,
gift_package_id: this.giftCodeForm.gift_package_id,
user_type: 1 user_type: 1
} }
const res = await sendGiftCode(data) const res = await sendGiftCode(data)
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论