123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293 |
- <template>
- <view class="page">
- <view class="list_info">
- <image class="new_join" mode="widthFix" src="../../static/sms/new_join.png"></image>
- <view class="name" v-if="type == 'newGroup'">创建群聊</view>
- <view class="name" v-if="type == 'joinGroup'">加入群聊</view>
- <image class="qun_img" mode="widthFix" src="../../static/sms/qun_img.png"></image>
- <input class="qun_name" v-model="name" placeholder="请输入群聊名称" />
- <view class="btn_submit" @click="submitData" v-if="type == 'newGroup'">立即创建</view>
- <view class="btn_submit" @click="submitData" v-if="type == 'joinGroup'">申请加入</view>
- <view class="blankHeight"></view>
- </view>
- <!-- 提示框 -->
- <DialogBox ref="DialogBox"></DialogBox>
- </view>
- </template>
- <script>
- export default {
- components: {},
- data() {
- return {
- type: 'newGroup',
- name: '',
- }
- },
- onLoad(parms) {
- this.type = parms.type || "newGroup"
- },
- onShow() {},
- methods: {
- onBack() {},
- submitData() {
- if (this.mobile == "") {
- uni.showToast({
- title: "请输入群聊名称",
- icon: 'none'
- });
- return;
- }
- let that = this;
- if (this.type == 'newGroup') {
- this.$refs['DialogBox'].confirm({
- title: '提示',
- content: '是否确定消耗100M币创建群聊',
- DialogType: 'inquiry',
- btn1: '否',
- btn2: '是',
- animation: 0
- }).then((res) => {
- that.submitData2();
- })
- } else {
- that.submitData2();
- }
- },
- submitData2() {
- uni.request({
- url: this.$apiHost2 + '/Chat/groupAction', //仅为示例,并非真实接口地址。
- data: {
- uuid: getApp().globalData.uuid,
- act: this.type,
- name: this.name
- },
- header: {
- 'content-type': 'application/json'
- },
- success: (res) => {
- console.log("res", res.data)
- uni.showToast({
- title: res.data.str,
- icon: 'none'
- });
- if (res.data.success == "yes") {
- setTimeout(function() {
- uni.navigateBack();
- }, 2000);
- }
- }
- });
- }
- }
- }
- </script>
- <style scoped lang="scss">
- @import 'newGroup.scss';
- </style>
|