123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145 |
- <template>
- <view>
- <u-navbar :is-back="true" :title="titles[type]" :background="{ background: '#F6F7F8' }" title-color="#404133" :border-bottom="false" z-index="1001">
- <view class="slot-wrap" slot="right">
- <u-button :disabled="isInput" size="mini" type="success" @click="save">保存</u-button>
- </view>
- </u-navbar>
- <u-cell-group>
- <u-input v-if="type=='0'" v-model="context" :auto-height="true" />
- <u-input v-if="type=='1'" v-model="context" :auto-height="true" />
- <u-input v-if="type=='2'" v-model="context" :auto-height="true" />
- <u-input v-if="type=='3'" v-model="context" :auto-height="true" />
- </u-cell-group>
- <view v-if="type=='0'">
- <view class="solid-bottom text-sm padding">
- <text class="text-grey">首次使用粮信请按要求修改名称</text>
- </view>
- <view class="solid-bottom text-sm padding">
- <text class="text-grey">请填写规范名称</text>
- </view>
- <view class="solid-bottom text-sm padding">
- <text class="text-grey">企业用户:公司-职务-姓名</text>
- </view>
- <view class="solid-bottom text-sm padding">
- <text class="text-grey">例:易粮易运-销售-张三</text>
- </view>
- <view class="solid-bottom text-sm padding">
- <text class="text-grey">个人用户:地址-姓名</text>
- </view>
- <view class="solid-bottom text-sm padding">
- <text class="text-grey">例:某烘干塔-张三</text>
- </view>
- </view>
- </view>
- </template>
- <script>
- export default {
- data() {
- return {
- type:'0',
- context:'',
- groupId:'',
- value: '',
- isInput:true,
- show: false,
- border: false,
- titles: ['设置名字','群名称','群公告','群昵称']
- }
- },
- watch:{
- context:function(v){
- this.isInput = v==undefined ? true : false;
- }
- },
- onLoad({groupId, context, type}) {
- this.groupId = groupId
- this.context = context
- this.type = type
- },
- onShow() {
- },
- methods: {
- save(){
-
- switch(this.type){
- case '0':
- this.updateNickName();
- break;
- case '1':
- this.updateGroupName();
- break;
- case '2':
- this.updateNotice();
- break;
- case '3':
- this.updateGroupNick();
- break;
- default:
- }
- },
- updateNickName () {
- console.log(this.userData)
- var that = this
- this.$socket.updateNickName(this.userData.user.operId, this.context, (res) => {
- if (res.success) {
- that.userData.user.realname = that.context
- that.$u.vuex("userData",that.userData)
- uni.showToast({
- title: '修改成功',
- duration: 1000,
- });
- setTimeout(()=>{uni.navigateBack({})},1000);
- }
- })
- },
- updateGroupName(){
- this.$socket.updateGroupName(this.userData.user.operId, this.groupId, this.context, res => {
- if(res.success){
- uni.showToast({
- title: '成功',
- duration: 2000,
- });
- }else{
- uni.showToast({
- title: '失败',
- duration: 2000,
- });
- }
- })
- },
- updateNotice(){
- this.$socket.updateNotice(this.userData.user.operId, this.groupId, this.context, res => {
- if(res.success){
- uni.showToast({
- title: '成功',
- duration: 2000,
- });
- }else{
- uni.showToast({
- title: '失败',
- duration: 2000,
- });
- }
- })
- },
- updateGroupNick(){
- this.$socket.updateGroupNick(this.userData.user.operId, this.groupId, this.context, res => {
- if(res.success){
- uni.showToast({
- title: '成功',
- duration: 2000,
- });
- }else{
- uni.showToast({
- title: '失败',
- duration: 2000,
- });
- }
- })
- }
- }
- };
- </script>
- <style></style>
|