Browse Source

群 平台设置完成

cr 4 years ago
parent
commit
13e23c5c7e

+ 36 - 0
src/common/js/plugin.js

@@ -390,4 +390,40 @@ export default {
390 390
     openSetting() {
391 391
         uni.openSetting()
392 392
     },
393
+
394
+
395
+    /**
396
+     * 转化为指定格式日期
397
+     * @param date
398
+     * @param format
399
+     * @returns {string}
400
+     */
401
+    dateFormat(date, format = 'yyyy-MM-dd') {
402
+        if (date) {
403
+            date = date.replace(/-/g, '/')
404
+            date = new Date(Date.parse(date))
405
+
406
+            let o = {
407
+                'M+': date.getMonth() + 1, //月份
408
+                'd+': date.getDate(), //日
409
+                'h+': date.getHours(), //小时
410
+                'm+': date.getMinutes(), //分
411
+                's+': date.getSeconds(), //秒
412
+                'S': date.getMilliseconds(), //毫秒
413
+                'q+': Math.floor((date.getMonth() + 3) / 3), //季度
414
+            }
415
+
416
+            if (/(y+)/.test(format)) {
417
+                format = format.replace(RegExp.$1, (date.getFullYear() + '').substr(4 - RegExp.$1.length))
418
+            }
419
+            for (let k in o) {
420
+                if (new RegExp('(' + k + ')').test(format)) {
421
+                    format = format.replace(RegExp.$1, (RegExp.$1.length == 1) ? (o[k]) : (('00' + o[k]).substr(('' + o[k]).length)))
422
+                }
423
+            }
424
+            return format
425
+        } else {
426
+            return ''
427
+        }
428
+    }
393 429
 }

+ 24 - 0
src/pages.json

@@ -459,6 +459,30 @@
459 459
                 "navigationBarTitleText": "账单记录",
460 460
                 "enablePullDownRefresh": true
461 461
             }
462
+        },
463
+        {
464
+            "path": "pages/assistant/set-platform",
465
+            "style": {
466
+                "navigationBarTitleText": "关联群平台"
467
+            }
468
+        },
469
+        {
470
+            "path": "pages/assistant/set-time",
471
+            "style": {
472
+                "navigationBarTitleText": "助理禁言时间"
473
+            }
474
+        },
475
+        {
476
+            "path": "pages/assistant/set-welcome",
477
+            "style": {
478
+                "navigationBarTitleText": "群欢迎设置"
479
+            }
480
+        },
481
+        {
482
+            "path": "pages/assistant/add-platform",
483
+            "style": {
484
+                "navigationBarTitleText": "添加平台"
485
+            }
462 486
         }
463 487
     ]
464 488
 }

+ 317 - 0
src/pages/assistant/add-platform.vue

@@ -0,0 +1,317 @@
1
+<template>
2
+    <div class="page">
3
+        <div v-if="step === 1">
4
+            <radio-group @change="radioChange">
5
+                <div class="list">
6
+                    <label
7
+                        class="item"
8
+                        v-for="item of list"
9
+                        :key="item.platform"
10
+                    >
11
+                        <radio
12
+                            :value="item.platform"
13
+                            :checked="false"
14
+                            :disabled="item.enabled"
15
+                        />
16
+                        <div class="name">
17
+                            {{ item.platformName }}
18
+                            <span class="enabled" v-if="item.enabled"
19
+                                >(已关联)</span
20
+                            >
21
+                        </div>
22
+                    </label>
23
+                </div>
24
+            </radio-group>
25
+            <button class="btn" @click="next()">下一步</button>
26
+        </div>
27
+
28
+        <div v-if="step === 2">
29
+            <div class="form-card">
30
+                <section class="form-item">
31
+                    <div class="label">
32
+                        <span class="required">*</span>
33
+                        团长id:
34
+                    </div>
35
+                    <div class="box">
36
+                        <div class="con">
37
+                            <input
38
+                                type="text"
39
+                                v-model="pid"
40
+                                placeholder="90000*****"
41
+                            />
42
+                        </div>
43
+                    </div>
44
+                </section>
45
+            </div>
46
+            <button class="btn" @click="save()">保存</button>
47
+        </div>
48
+    </div>
49
+</template>
50
+
51
+<script>
52
+import MyImage from "../../components/image/index";
53
+export default {
54
+    name: "",
55
+    components: { MyImage },
56
+
57
+    // 数据
58
+    data() {
59
+        return {
60
+            switchChecked: false,
61
+            groupData: {},
62
+            activeValue: "",
63
+            pid: "",
64
+            step: 1,
65
+            list: [],
66
+        };
67
+    },
68
+
69
+    onLoad(opts) {
70
+        this.getAvailablePlatforms();
71
+    },
72
+    async onShow() {},
73
+    // 函数
74
+    methods: {
75
+        getAvailablePlatforms() {
76
+            this.api
77
+                .get("/Group/GetAvailablePlatforms", {}, { pass: true })
78
+                .then((res) => {
79
+                    this.list = res.data;
80
+                });
81
+        },
82
+
83
+        radioChange: function (v) {
84
+            this.activeValue = v.detail.value;
85
+        },
86
+
87
+        next() {
88
+            if (!this.activeValue) {
89
+                return this.fn.showModal({
90
+                    content: "请先选择平台",
91
+                    showCancel: false,
92
+                });
93
+            }
94
+            this.step = 2;
95
+        },
96
+
97
+        save() {
98
+            if (!this.pid) {
99
+                return this.fn.showToast(`请输入团长id`);
100
+            }
101
+            uni.showLoading({
102
+                title: "提交中",
103
+            });
104
+            let sendData = {
105
+                pid: this.pid,
106
+                platform: this.activeValue,
107
+            };
108
+            this.api
109
+                .get("/Group/GetGroupInfo", sendData, { pass: true })
110
+                .then((res) => {
111
+                    uni.hideLoading();
112
+                    if (res.success) {
113
+                        if (res.data) {
114
+                            this.fn
115
+                                .showModal({
116
+                                    title: "团长信息",
117
+                                    content: `当前团店铺名称为:${res.data.shopName},是否确认提交`,
118
+                                })
119
+                                .then((res) => {
120
+                                    if (res.confirm) {
121
+                                        this.commitPid(sendData);
122
+                                    } else {
123
+                                    }
124
+                                });
125
+                        } else {
126
+                            this.fn.showModal({
127
+                                title: "获取团长信息失败",
128
+                                content: "当前团长号未获取到团长信息",
129
+                                showCancel: false,
130
+                            });
131
+                        }
132
+                    } else {
133
+                        this.fn.showModal({
134
+                            title: "获取团长信息失败",
135
+                            content: res.message,
136
+                            showCancel: false,
137
+                        });
138
+                    }
139
+                });
140
+        },
141
+
142
+        commitPid(sendData) {
143
+            let pName = "";
144
+            for (let item of this.list) {
145
+                if (item.platform === this.activeValue) {
146
+                    pName = item.platformName;
147
+                }
148
+            }
149
+            this.api
150
+                .post("/Group/AddJDPlatform", sendData, { pass: true })
151
+                .then((res) => {
152
+                    if (!res.success) {
153
+                        this.fn.showModal({
154
+                            title: "添加平台成功",
155
+                            content: `你已成功添加${1},如果需要在群内关联平台,请在群详情下关联平台,获取点击“一键关联群”,现在一键关联`,
156
+                            confirmText: "一键关联",
157
+                            cancelText: "稍后关联",
158
+                            confirmColor: "#42b983",
159
+                            success: (res2) => {
160
+                                if (res2.confirm) {
161
+                                    this.enableShopJDPlatform();
162
+                                } else {
163
+                                    this.router.back();
164
+                                }
165
+                            },
166
+                        });
167
+                    } else {
168
+                        this.fn.showModal({
169
+                            title: "团长号提交失败",
170
+                            content: res.message,
171
+                            showCancel: false,
172
+                        });
173
+                    }
174
+                });
175
+        },
176
+
177
+        enableShopJDPlatform() {
178
+            this.api
179
+                .get("/Group/enableShopJDPlatform", {}, { pass: true })
180
+                .then((res) => {
181
+                    if (res.success) {
182
+                        this.fn.showToast("一键关联成功");
183
+                        this.router.back();
184
+                    } else {
185
+                        this.fn.showModal({
186
+                            title: "一键关联失败",
187
+                            content: res.message,
188
+                            showCancel: false,
189
+                        });
190
+                    }
191
+                });
192
+        },
193
+    },
194
+
195
+    // 数据计算
196
+    computed: {
197
+        user() {
198
+            return this.$store.state.user.user;
199
+        },
200
+    },
201
+
202
+    // 数据监听
203
+    watch: {},
204
+};
205
+</script>
206
+
207
+<style lang="scss" scoped>
208
+.page {
209
+    min-height: 100vh;
210
+    background-color: #fff;
211
+    padding-bottom: 4rem;
212
+}
213
+.list {
214
+    border-top: 1px solid #f1f1f1;
215
+    .item {
216
+        height: px(130);
217
+        padding: 0 px(35);
218
+        font-size: px(44);
219
+        display: flex;
220
+        // justify-content: space-between;
221
+        align-items: center;
222
+        border-bottom: 1px solid #f1f1f1;
223
+    }
224
+    .arrow {
225
+        width: px(40);
226
+        height: px(40);
227
+        flex-shrink: 0;
228
+        transform: rotate(180deg);
229
+        /deep/ img {
230
+            width: px(40);
231
+            height: px(40);
232
+        }
233
+    }
234
+}
235
+switch {
236
+    transform: scale(0.7);
237
+}
238
+.btn {
239
+    position: fixed;
240
+    bottom: 1rem;
241
+    left: px(30);
242
+    right: px(30);
243
+    z-index: 10;
244
+    color: #fff;
245
+    background-color: rgb(0, 188, 38);
246
+    font-size: px(44);
247
+}
248
+.form-card {
249
+    background-color: #fff;
250
+    padding: 0 px(30);
251
+    & ~ .form-card {
252
+        margin-top: px(25);
253
+    }
254
+    .head {
255
+        display: flex;
256
+        align-items: center;
257
+        justify-content: space-between;
258
+        height: px(140);
259
+        background-color: #fbfbfb;
260
+        border-bottom: 1px solid #f1f1f1;
261
+        border-top: 1px solid #f1f1f1;
262
+        font-size: px(44);
263
+    }
264
+}
265
+.form-item {
266
+    display: flex;
267
+    min-height: px(140);
268
+    padding: px(30) 0;
269
+    box-sizing: border-box;
270
+    align-items: center;
271
+    font-size: px(44);
272
+    border-bottom: 1px solid #f1f1f1;
273
+    &.dis-item {
274
+        color: #999;
275
+        background: #f9f9f9;
276
+    }
277
+    .label {
278
+        width: px(240);
279
+        flex-shrink: 0;
280
+        color: #999;
281
+        margin-right: px(10);
282
+    }
283
+    .box {
284
+        width: 100%;
285
+        position: relative;
286
+        input {
287
+            width: 100%;
288
+        }
289
+    }
290
+    .tool {
291
+        flex-shrink: 0;
292
+        color: #999;
293
+        margin-left: px(10);
294
+    }
295
+    .tip {
296
+        font-size: px(36);
297
+        color: #e6a23c;
298
+        margin-top: px(5);
299
+    }
300
+    textarea,
301
+    input {
302
+        max-width: 100%;
303
+        width: 100%;
304
+    }
305
+}
306
+.required {
307
+    color: #f00;
308
+    font-size: px(44);
309
+    &.hide {
310
+        visibility: hidden;
311
+    }
312
+}
313
+.enabled {
314
+    color: #999;
315
+    margin-left: px(30);
316
+}
317
+</style>

+ 43 - 28
src/pages/assistant/index.vue

@@ -13,47 +13,62 @@
13 13
                 </ul>
14 14
             </div>
15 15
             <!-- 群 -->
16
-            <ul class="group-list" v-if="tabIndex === 0">
17
-                <block v-for="data of dataList" :key="data._id">
18
-                    <li class="item" @click="jumpGroup(data)">
16
+            <div v-if="tabIndex === 0">
17
+                <ul class="group-list">
18
+                    <block v-for="data of dataList" :key="data._id">
19
+                        <li class="item" @click="jumpGroup(data)">
20
+                            <div class="name">
21
+                                {{ data.name | maxTit }}
22
+                            </div>
23
+                            <my-image
24
+                                class="arrow"
25
+                                src="/static/common/arrows_left.png"
26
+                            ></my-image>
27
+                        </li>
28
+                    </block>
29
+                </ul>
30
+                <button
31
+                    class="btn"
32
+                    @click="
33
+                        jump({
34
+                            path: '/pages/assistant/add',
35
+                        })
36
+                    "
37
+                >
38
+                    添加群
39
+                </button>
40
+            </div>
41
+
42
+            <!-- 平台 -->
43
+            <div v-if="tabIndex === 1">
44
+                <ul class="group-list">
45
+                    <li
46
+                        class="item"
47
+                        v-for="item of platformList"
48
+                        :key="item.name"
49
+                        @click="jumpPlatform(item)"
50
+                    >
19 51
                         <div class="name">
20
-                            {{ data.name | maxTit }}
52
+                            {{ item.name | maxTit }}
21 53
                         </div>
22 54
                         <my-image
23 55
                             class="arrow"
24 56
                             src="/static/common/arrows_left.png"
25 57
                         ></my-image>
26 58
                     </li>
27
-                </block>
59
+                </ul>
60
+
28 61
                 <button
29 62
                     class="btn"
30 63
                     @click="
31 64
                         jump({
32
-                            path: '/pages/assistant/add',
65
+                            path: '/pages/assistant/add-platform',
33 66
                         })
34 67
                     "
35 68
                 >
36
-                    添加群
69
+                    添加平台
37 70
                 </button>
38
-            </ul>
39
-
40
-            <!-- 平台 -->
41
-            <ul class="group-list" v-if="tabIndex === 1">
42
-                <li
43
-                    class="item"
44
-                    v-for="item of platformList"
45
-                    :key="item.name"
46
-                    @click="jumpPlatform(item)"
47
-                >
48
-                    <div class="name">
49
-                        {{ item.name | maxTit }}
50
-                    </div>
51
-                    <my-image
52
-                        class="arrow"
53
-                        src="/static/common/arrows_left.png"
54
-                    ></my-image>
55
-                </li>
56
-            </ul>
71
+            </div>
57 72
         </div>
58 73
 
59 74
         <!-- <div class="layout" @click="layout">退出登录</div> -->
@@ -72,7 +87,7 @@ import ManageNav from "../../components/layout/manage-nav";
72 87
 
73 88
 export default {
74 89
     name: "",
75
-    components: { MyImage, wygBottomTab,ManageNav },
90
+    components: { MyImage, wygBottomTab, ManageNav },
76 91
     // 数据
77 92
     data() {
78 93
         return {
@@ -81,7 +96,7 @@ export default {
81 96
             dataList: [],
82 97
             dataEnd: false,
83 98
             platformList: [],
84
-            shopId:'',
99
+            shopId: "",
85 100
         };
86 101
     },
87 102
     filters: {

+ 116 - 0
src/pages/assistant/set-platform.vue

@@ -0,0 +1,116 @@
1
+<template>
2
+    <div class="page">
3
+        <ul class="list">
4
+            <li class="item" v-for="item of list" :key="item.platform">
5
+                <div class="name">{{item.platformName}}</div>
6
+                <!-- <my-image
7
+                    class="arrow"
8
+                    src="/static/common/arrows_left.png"
9
+                ></my-image> -->
10
+                <switch
11
+                    :checked="item.enabled"
12
+                    @change="switchChange($event,item)"
13
+                ></switch>
14
+            </li>
15
+        </ul>
16
+    </div>
17
+</template>
18
+
19
+<script>
20
+import MyImage from "../../components/image/index";
21
+export default {
22
+    name: "",
23
+    components: { MyImage },
24
+
25
+    // 数据
26
+    data() {
27
+        return {
28
+            groupData: {},
29
+            list:[]
30
+        };
31
+    },
32
+
33
+    onLoad(opts) {
34
+        this.groupData = this.$store.state.common.groupData;
35
+        this.getGroupPlatform();
36
+    },
37
+    async onShow() {},
38
+    // 函数
39
+    methods: {
40
+
41
+        // 获取群平台
42
+        getGroupPlatform(){
43
+            this.api.get('/Group/GetGroupPlatform',{gid:this.groupData._id},{pass:true})
44
+                .then(res=>{
45
+                    this.list = res.data;
46
+                })
47
+        },
48
+
49
+        switchChange(e,item) {
50
+            let detail = e.detail.value;
51
+            let data = {
52
+                gid: this.groupData._id,
53
+                isDisable: detail ? false : true,
54
+            };
55
+
56
+            this.api
57
+                .get("/Group/EnableGroupJdPlatform", data, { pass: true })
58
+                .then((res) => {
59
+                    uni.hideLoading();
60
+                    if (res.success) {
61
+                        this.fn.showToast("设置成功");
62
+                    } else {
63
+                        item.switchChecked = !item.switchChecked;
64
+                        this.fn.showModal({
65
+                            title: "设置失败",
66
+                            content: "错误信息:" + res.message,
67
+                            showCancel: false,
68
+                        });
69
+                    }
70
+                });
71
+        },
72
+    },
73
+
74
+    // 数据计算
75
+    computed: {
76
+        user() {
77
+            return this.$store.state.user.user;
78
+        },
79
+    },
80
+
81
+    // 数据监听
82
+    watch: {},
83
+};
84
+</script>
85
+
86
+<style lang="scss" scoped>
87
+.page {
88
+    min-height: 100vh;
89
+    background-color: #fff;
90
+}
91
+.list {
92
+    border-top: 1px solid #f1f1f1;
93
+    .item {
94
+        height: px(120);
95
+        padding: 0 px(35);
96
+        font-size: px(44);
97
+        display: flex;
98
+        justify-content: space-between;
99
+        align-items: center;
100
+        border-bottom: 1px solid #f1f1f1;
101
+    }
102
+    .arrow {
103
+        width: px(40);
104
+        height: px(40);
105
+        flex-shrink: 0;
106
+        transform: rotate(180deg);
107
+        /deep/ img {
108
+            width: px(40);
109
+            height: px(40);
110
+        }
111
+    }
112
+}
113
+switch {
114
+    transform: scale(0.7);
115
+}
116
+</style>

+ 347 - 0
src/pages/assistant/set-time.vue

@@ -0,0 +1,347 @@
1
+<template>
2
+    <div class="page" :class="{ 'page--iphoneX': iphoneX }">
3
+        <div class="form-card">
4
+            <section class="form-item">
5
+                <div class="label">
6
+                    <span class="required">*</span>
7
+                    开始时间:
8
+                </div>
9
+                <div class="box">
10
+                    <picker
11
+                        mode="time"
12
+                        @change="timeChange($event, 'startTime')"
13
+                    >
14
+                        <input
15
+                            type="text"
16
+                            :disabled="true"
17
+                            v-model="form.startTime"
18
+                            placeholder="请选择"
19
+                        />
20
+                    </picker>
21
+                </div>
22
+            </section>
23
+            <section class="form-item">
24
+                <div class="label">
25
+                    <span class="required">*</span>
26
+                    结束时间:
27
+                </div>
28
+                <div class="box">
29
+                    <picker mode="time" @change="timeChange($event, 'endTime')">
30
+                        <input
31
+                            type="text"
32
+                            :disabled="true"
33
+                            v-model="form.endTime"
34
+                            placeholder="请选择"
35
+                        />
36
+                    </picker>
37
+                </div>
38
+            </section>
39
+        </div>
40
+        <div class="btn" @click="saveOk">保存</div>
41
+    </div>
42
+</template>
43
+
44
+<script>
45
+import MyImage from "../../components/image/index";
46
+
47
+export default {
48
+    name: "",
49
+    components: { MyImage },
50
+    // 数据
51
+    data() {
52
+        return {
53
+            submitLoading: false,
54
+            form: {
55
+                startTime: "",
56
+                endTime: "",
57
+            },
58
+            groupData: {},
59
+        };
60
+    },
61
+
62
+    onLoad() {
63
+        this.groupData = this.$store.state.common.groupData;
64
+        this.form.startTime = this.fn.dateFormat(
65
+            this.groupData.startMute,
66
+            "hh:mm"
67
+        );
68
+        this.form.endTime = this.fn.dateFormat(this.groupData.endMute, "hh:mm");
69
+        console.log(this.groupData);
70
+    },
71
+
72
+    onShow() {},
73
+
74
+    // 函数
75
+    methods: {
76
+        timeChange(e, name) {
77
+            let time = e.detail.value;
78
+            this.form[name] = time;
79
+            // console.log(e,name);
80
+        },
81
+        saveOk() {
82
+            if (this.submitLoading) {
83
+                return;
84
+            }
85
+            if (!this.form.startTime) {
86
+                return this.fn.showToast("请选择开始时间");
87
+            }
88
+            if (!this.form.startTime) {
89
+                return this.fn.showToast("请选择结束时间");
90
+            }
91
+            uni.showLoading({
92
+                title: "提交中...",
93
+                mask: true,
94
+            });
95
+            let data = {
96
+                startMute: this.form.startTime,
97
+                endMute: this.form.endTime,
98
+                groupId: this.groupData._id,
99
+            };
100
+
101
+            console.log(data);
102
+            this.submitLoading = true;
103
+            this.api
104
+                .post("/Group/SetMuteTime", data, { pass: true })
105
+                .then((res) => {
106
+                    this.submitLoading = false;
107
+                    uni.hideLoading();
108
+                    if (res.success) {
109
+                        this.fn.showToast("修改成功");
110
+                        this.router.back();
111
+                    } else {
112
+                        this.fn.showModal({
113
+                            title: "修改失败",
114
+                            content: "错误信息:" + res.message,
115
+                            showCancel: false,
116
+                        });
117
+                    }
118
+                });
119
+        },
120
+    },
121
+
122
+    // 数据计算
123
+    computed: {},
124
+
125
+    // 数据监听
126
+    watch: {},
127
+};
128
+</script>
129
+
130
+
131
+<style lang="scss" scoped>
132
+.page {
133
+    padding-bottom: px(120);
134
+    min-height: 100vh;
135
+}
136
+.page--iphoneX {
137
+    padding-bottom: px(150);
138
+    .btn {
139
+        padding-bottom: px(30);
140
+        background-color: rgb(0, 188, 38);
141
+    }
142
+}
143
+.form-card {
144
+    background-color: #fff;
145
+    padding: 0 px(30);
146
+    & ~ .form-card {
147
+        margin-top: px(25);
148
+    }
149
+    .head {
150
+        display: flex;
151
+        align-items: center;
152
+        justify-content: space-between;
153
+        height: px(140);
154
+        background-color: #fbfbfb;
155
+        border-bottom: 1px solid #f1f1f1;
156
+        border-top: 1px solid #f1f1f1;
157
+        font-size: px(44);
158
+    }
159
+}
160
+.form-item {
161
+    display: flex;
162
+    min-height: px(140);
163
+    padding: px(30) 0;
164
+    box-sizing: border-box;
165
+    align-items: center;
166
+    font-size: px(44);
167
+    &.dis-item {
168
+        color: #999;
169
+        background: #f9f9f9;
170
+    }
171
+    & ~ .form-item {
172
+        border-top: 1px solid #f1f1f1;
173
+    }
174
+    .label {
175
+        width: px(240);
176
+        flex-shrink: 0;
177
+        color: #999;
178
+        margin-right: px(10);
179
+    }
180
+    .box {
181
+        width: 100%;
182
+        position: relative;
183
+        input {
184
+            width: 100%;
185
+        }
186
+    }
187
+    .tool {
188
+        flex-shrink: 0;
189
+        color: #999;
190
+        margin-left: px(10);
191
+    }
192
+    .tip {
193
+        font-size: px(36);
194
+        color: #e6a23c;
195
+        margin-top: px(5);
196
+    }
197
+    textarea,
198
+    input {
199
+        max-width: 100%;
200
+        width: 100%;
201
+    }
202
+}
203
+.list {
204
+    // min-height: 100vh;
205
+    // background-color: #fff;
206
+    // border-bottom: 1px solid #f1f1f1;
207
+    li {
208
+        padding: px(0) px(35);
209
+        height: px(140);
210
+        line-height: px(140);
211
+        font-size: px(44);
212
+        border-top: 1px solid #f1f1f1;
213
+        display: flex;
214
+        justify-content: space-between;
215
+        align-items: center;
216
+    }
217
+    .tools {
218
+        display: flex;
219
+        align-items: center;
220
+        flex-shrink: 0;
221
+        span {
222
+            display: inline-block;
223
+            border: 1px solid #f1f1f1;
224
+            font-size: px(36);
225
+            height: px(80);
226
+            width: px(120);
227
+            display: flex;
228
+            justify-content: center;
229
+            align-items: center;
230
+            & ~ span {
231
+                margin-left: px(30);
232
+            }
233
+        }
234
+        .remove {
235
+            color: #f00;
236
+        }
237
+    }
238
+}
239
+.btn {
240
+    position: fixed;
241
+    bottom: 0;
242
+    left: 0;
243
+    right: 0;
244
+    width: 100%;
245
+    height: px(120);
246
+    background-color: rgb(0, 188, 38);
247
+    color: #fff;
248
+    display: flex;
249
+    align-items: center;
250
+    justify-content: center;
251
+    z-index: 100;
252
+}
253
+.add-btn {
254
+    height: px(120);
255
+    color: #333;
256
+    display: flex;
257
+    align-items: center;
258
+    justify-content: center;
259
+    margin: px(50) px(35) 0;
260
+    border: 1px solid #ccc;
261
+    border-radius: px(10);
262
+}
263
+.code-tool {
264
+    display: flex;
265
+    justify-content: flex-start;
266
+    align-items: center;
267
+    .scan-img {
268
+        flex-shrink: 0;
269
+        width: px(80);
270
+        height: px(80);
271
+        /deep/ img {
272
+            width: px(80);
273
+            height: px(80);
274
+        }
275
+    }
276
+    .generate {
277
+        color: #0097d1;
278
+        margin-right: px(30);
279
+        flex-shrink: 0;
280
+    }
281
+}
282
+.required {
283
+    color: #f00;
284
+    font-size: px(44);
285
+    &.hide {
286
+        visibility: hidden;
287
+    }
288
+}
289
+.inp-dis {
290
+    color: #999;
291
+}
292
+
293
+.img-card {
294
+    padding-top: px(30);
295
+    padding-bottom: px(30);
296
+}
297
+.form-img-item {
298
+    .tit {
299
+        padding: px(30);
300
+        font-size: px(44);
301
+    }
302
+}
303
+
304
+.spec-list {
305
+    width: 100%;
306
+    display: flex;
307
+    justify-content: space-between;
308
+    align-items: center;
309
+    li {
310
+        width: 33.333333%;
311
+        font-size: px(40);
312
+        height: px(100);
313
+        border: 1px solid #f1f1f1;
314
+        display: flex;
315
+        align-items: center;
316
+        justify-content: center;
317
+        color: #999;
318
+        & ~ li {
319
+            // border-left: none;
320
+        }
321
+        &.on {
322
+            color: rgb(0, 188, 38);
323
+            border-color: rgb(0, 188, 38);
324
+        }
325
+    }
326
+}
327
+.mo-date {
328
+    margin-top: px(20);
329
+    border-bottom: 1px solid #f1f1f1;
330
+    background: #fbfbfb;
331
+    font-size: px(40);
332
+    padding: px(10);
333
+}
334
+.n-date-box {
335
+    margin-top: px(20);
336
+    font-size: px(40);
337
+}
338
+.n-date {
339
+    border-bottom: 1px solid #f1f1f1;
340
+    background: #fbfbfb;
341
+    padding: 0 px(20);
342
+    display: inline-block;
343
+    width: px(200);
344
+    font-size: px(44);
345
+    vertical-align: bottom;
346
+}
347
+</style>

+ 0 - 0
src/pages/assistant/set-welcome.vue


+ 32 - 1
src/pages/assistant/setting.vue

@@ -1,6 +1,27 @@
1 1
 <template>
2 2
     <div class="page">
3 3
         <ul class="list">
4
+            <li class="item" @click="jump('/pages/assistant/set-welcome')">
5
+                <div class="name">群欢迎设置</div>
6
+                <my-image
7
+                    class="arrow"
8
+                    src="/static/common/arrows_left.png"
9
+                ></my-image>
10
+            </li>
11
+            <li class="item" @click="jump('/pages/assistant/set-time')">
12
+                <div class="name">助理禁言时间</div>
13
+                <my-image
14
+                    class="arrow"
15
+                    src="/static/common/arrows_left.png"
16
+                ></my-image>
17
+            </li>
18
+            <li class="item" @click="jump('/pages/assistant/set-platform')">
19
+                <div class="name">群关联平台</div>
20
+                <my-image
21
+                    class="arrow"
22
+                    src="/static/common/arrows_left.png"
23
+                ></my-image>
24
+            </li>
4 25
             <li class="item">
5 26
                 <div class="name">暂停本群助理</div>
6 27
                 <!-- <my-image
@@ -34,7 +55,17 @@ export default {
34 55
         this.groupData = this.$store.state.common.groupData;
35 56
         this.switchChecked = this.groupData.status === 1 ? true : false;
36 57
     },
37
-    async onShow() {},
58
+    async onShow() {
59
+        this.api
60
+            .get("/Group/GetGroup", { gid: this.groupData._id }, { pass: true })
61
+            .then((res) => {
62
+                this.$store.commit("common/update", {
63
+                    groupData: res.data,
64
+                });
65
+                this.groupData = res.data;
66
+            });
67
+    },
68
+
38 69
     // 函数
39 70
     methods: {
40 71
         switchChange(e) {

+ 19 - 13
src/pages/index/register.vue

@@ -388,19 +388,27 @@ export default {
388 388
             this.api
389 389
                 .get("/Group/GetGroupInfo", sendData, { pass: true })
390 390
                 .then((res) => {
391
-                    if (res.success) {
392 391
                     uni.hideLoading();
393
-                        this.fn
394
-                            .showModal({
395
-                                title: "团长信息",
396
-                                content: `当前团店铺名称为:${res.data.shopName},是否确认提交`,
397
-                            })
398
-                            .then((res) => {
399
-                                if (res.confirm) {
400
-                                    this.commitPid(sendData);
401
-                                } else {
402
-                                }
392
+                    if (res.success) {
393
+                        if (res.data) {
394
+                            this.fn
395
+                                .showModal({
396
+                                    title: "团长信息",
397
+                                    content: `当前团店铺名称为:${res.data.shopName},是否确认提交`,
398
+                                })
399
+                                .then((res) => {
400
+                                    if (res.confirm) {
401
+                                        this.commitPid(sendData);
402
+                                    } else {
403
+                                    }
404
+                                });
405
+                        } else {
406
+                            this.fn.showModal({
407
+                                title: "获取团长信息失败",
408
+                                content: "当前团长号未获取到团长信息",
409
+                                showCancel: false,
403 410
                             });
411
+                        }
404 412
                     } else {
405 413
                         this.fn.showModal({
406 414
                             title: "获取团长信息失败",
@@ -412,8 +420,6 @@ export default {
412 420
         },
413 421
 
414 422
         commitPid(sendData) {
415
-
416
-
417 423
             this.api
418 424
                 .post("/Group/CommitPid", sendData, { pass: true })
419 425
                 .then((res) => {

+ 1 - 1
src/pages/manage/index.vue

@@ -76,7 +76,7 @@
76 76
 
77 77
         <!-- <button class="btn" @click="layout">退出登录</button> -->
78 78
 
79
-        <div class="ver">0.5.11</div>
79
+        <div class="ver">0.5.12</div>
80 80
         <wyg-bottom-tab
81 81
             ref="tabbar"
82 82
             :tabIndex="2"

+ 73 - 69
src/pages/manage/shop/set-shop.vue

@@ -23,7 +23,6 @@
23 23
                 <div class="box">
24 24
                     <input
25 25
                         type="number"
26
-                        :disabled="true"
27 26
                         v-model="form.managerTelephone"
28 27
                         placeholder=" "
29 28
                     />
@@ -35,13 +34,16 @@
35 34
                     营业开始时间:
36 35
                 </div>
37 36
                 <div class="box">
38
-                    <picker mode="time" @change="timeChange($event,'startTime')">
39
-                    <input
40
-                        type="text"
41
-                        :disabled="true"
42
-                        v-model="form.startTime"
43
-                        placeholder="请选择"
44
-                    />
37
+                    <picker
38
+                        mode="time"
39
+                        @change="timeChange($event, 'startTime')"
40
+                    >
41
+                        <input
42
+                            type="text"
43
+                            :disabled="true"
44
+                            v-model="form.startTime"
45
+                            placeholder="请选择"
46
+                        />
45 47
                     </picker>
46 48
                 </div>
47 49
             </section>
@@ -51,13 +53,13 @@
51 53
                     营业结束时间:
52 54
                 </div>
53 55
                 <div class="box">
54
-                    <picker mode="time" @change="timeChange($event,'endTime')">
55
-                    <input
56
-                        type="text"
57
-                        :disabled="true"
58
-                        v-model="form.endTime"
59
-                        placeholder="请选择"
60
-                    />
56
+                    <picker mode="time" @change="timeChange($event, 'endTime')">
57
+                        <input
58
+                            type="text"
59
+                            :disabled="true"
60
+                            v-model="form.endTime"
61
+                            placeholder="请选择"
62
+                        />
61 63
                     </picker>
62 64
                 </div>
63 65
             </section>
@@ -91,17 +93,18 @@
91 93
                 </div>
92 94
             </section>
93 95
             <section class="form-item">
94
-                <div class="label">
95
-                    
96
-                    店铺通知:
97
-                </div>
96
+                <div class="label">店铺通知:</div>
98 97
                 <div class="box">
99 98
                     <!-- <input
100 99
                         type="text"
101 100
                         
102 101
                     /> -->
103
-                    <textarea v-model="form.shopNotice" :maxlength="2048" :auto-height="true"
104
-                        placeholder="请填写店铺通知"></textarea>
102
+                    <textarea
103
+                        v-model="form.shopNotice"
104
+                        :maxlength="2048"
105
+                        :auto-height="true"
106
+                        placeholder="请填写店铺通知"
107
+                    ></textarea>
105 108
                 </div>
106 109
             </section>
107 110
         </div>
@@ -123,13 +126,13 @@ export default {
123 126
     data() {
124 127
         return {
125 128
             form: {
126
-                appName:'',
127
-                managerTelephone:'',
128
-                startTime:'',
129
-                endTime:'',
130
-                logo:'',
131
-                shopBanner:'',
132
-                shopNotice:'',
129
+                appName: "",
130
+                managerTelephone: "",
131
+                startTime: "",
132
+                endTime: "",
133
+                logo: "",
134
+                shopBanner: "",
135
+                shopNotice: "",
133 136
             },
134 137
             mainImage: [],
135 138
             mainImage2: [],
@@ -145,39 +148,42 @@ export default {
145 148
 
146 149
     // 函数
147 150
     methods: {
148
-        getData(){
149
-            this.api.get('/Shop/GetInfo',{},{pass:true})
150
-                .then(res=>{
151
-                    if(res.success && res.data){
152
-                        this.form.appName = res.data.name;
153
-                        this.form.managerTelephone = res.data.managerTelephone;
154
-                        this.form.startTime = res.data.startTime;
155
-                        this.form.endTime = res.data.endTime;
156
-                        this.form.logo = res.data.logo;
157
-                        this.form.shopBanner = res.data.shopBanner;
158
-                        this.form.shopNotice = res.data.shopNotice;
159
-                        this.mainImage = this.form.logo?[this.form.logo]:[];
160
-                        this.mainImage2 = this.form.shopBanner?[this.form.shopBanner]:[];
161
-                    }else{
162
-                           this.fn.showModal({
163
-                            content:res.message,
151
+        getData() {
152
+            this.api.get("/Shop/GetInfo", {}, { pass: true }).then((res) => {
153
+                if (res.success && res.data) {
154
+                    this.form.appName = res.data.name;
155
+                    this.form.managerTelephone = res.data.managerTelephone;
156
+                    this.form.startTime = res.data.startTime;
157
+                    this.form.endTime = res.data.endTime;
158
+                    this.form.logo = res.data.logo;
159
+                    this.form.shopBanner = res.data.shopBanner;
160
+                    this.form.shopNotice = res.data.shopNotice;
161
+                    this.mainImage = this.form.logo ? [this.form.logo] : [];
162
+                    this.mainImage2 = this.form.shopBanner
163
+                        ? [this.form.shopBanner]
164
+                        : [];
165
+                } else {
166
+                    this.fn
167
+                        .showModal({
168
+                            content: res.message,
164 169
                             showCancel: false,
165
-                        }).then(res=>{
166
-                            if(res.confirm){
170
+                        })
171
+                        .then((res) => {
172
+                            if (res.confirm) {
167 173
                                 this.router.back();
168 174
                             }
169
-                        })
170
-                    }
171
-                })
175
+                        });
176
+                }
177
+            });
172 178
         },
173 179
 
174 180
         minImgChange(e) {
175
-            this.form.logo = e[0] || '';
181
+            this.form.logo = e[0] || "";
176 182
         },
177 183
         minImgChange2(e) {
178 184
             this.form.shopBanner = e[0] || "";
179 185
         },
180
-        timeChange(e,name){
186
+        timeChange(e, name) {
181 187
             let time = e.detail.value;
182 188
             this.form[name] = time;
183 189
             // console.log(e,name);
@@ -211,7 +217,7 @@ export default {
211 217
             // if (this.form.iDCard.length !== 2) {
212 218
             //     return this.fn.showToast("请分别上传身份证照正反面");
213 219
             // }
214
-            if(this.user.parentInviteCode){
220
+            if (this.user.parentInviteCode) {
215 221
                 this.form.invitedCode = this.user.parentInviteCode;
216 222
             }
217 223
             console.log(this.form);
@@ -220,22 +226,20 @@ export default {
220 226
                 title: "提交中...",
221 227
             });
222 228
             let data = { ...this.form };
223
-            this.api
224
-                .post("/Shop/Set", data, { pass: true })
225
-                .then((res) => {
226
-                    this.submitLoading = false;
227
-                    uni.hideLoading();
228
-                    if (res.success) {
229
-                        this.fn.showToast("设置成功");
230
-                        this.router.back();
231
-                    } else {
232
-                        this.fn.showModal({
233
-                            title:'设置失败',
234
-                            content:res.message,
235
-                            showCancel: false,
236
-                        });
237
-                    }
238
-                });
229
+            this.api.post("/Shop/Set", data, { pass: true }).then((res) => {
230
+                this.submitLoading = false;
231
+                uni.hideLoading();
232
+                if (res.success) {
233
+                    this.fn.showToast("设置成功");
234
+                    this.router.back();
235
+                } else {
236
+                    this.fn.showModal({
237
+                        title: "设置失败",
238
+                        content: res.message,
239
+                        showCancel: false,
240
+                    });
241
+                }
242
+            });
239 243
         },
240 244
     },
241 245
 
@@ -474,7 +478,7 @@ export default {
474 478
         height: px(60);
475 479
     }
476 480
 }
477
-.dis{
481
+.dis {
478 482
     background-color: #f6f6f6;
479 483
 }
480 484
 </style>