panhui %!s(int64=4) %!d(string=hai) anos
pai
achega
46181d688b

+ 4 - 4
src/pages/changeText.vue

@@ -8,10 +8,10 @@
         <van-field
             type="text"
             clearable
-            placeholder="请输入昵称"
+            placeholder="请输入..."
             :value="message"
             focus
-            @change="message = $event.detail"
+            @input="message = $event.detail"
             @comfirm="message = $event.detail"
         />
 
@@ -37,9 +37,9 @@ export default {
             });
             eventChannel.on('title', data => {
                 wx.setNavigationBarTitle({
-                    title: data
+                    title: data.title
                 });
-                this.key = 'storeName';
+                this.key = data.key;
             });
         }
     },

+ 2 - 1
src/pages/mine.vue

@@ -48,7 +48,7 @@
                 height="86"
                 src="https://ticket-exchange.oss-cn-hangzhou.aliyuncs.com/wechat/info_img_renzhengdianjia1.png"
                 fit="contain"
-                @click="navigateTo('/pages/store/apply')"
+                @click="goAuth"
             />
         </div>
 
@@ -158,6 +158,7 @@ export default {
         goAuth() {
             this.checkAuthen()
                 .then(res => {
+                    // this.$http.get('/storeAuthentication/pass/' + res.id);
                     this.navigateTo('/pages/store/apply');
                 })
                 .catch(() => {

+ 12 - 2
src/pages/store/apply.vue

@@ -41,6 +41,14 @@
                 :value="form2.email"
                 @input="form.email = $event.detail"
             />
+
+            <van-field
+                type="text"
+                label="主播微信号"
+                placeholder="请输入店铺直播的主播微信号(选填)"
+                :value="form2.wxUsername"
+                @input="form.wxUsername = $event.detail"
+            />
             <van-field
                 type="idcard"
                 label="身份证号"
@@ -77,7 +85,8 @@ export default {
                 email: '',
                 idNo: '',
                 idNoImage: '',
-                licenseImage: ''
+                licenseImage: '',
+                wxUsername: ''
             },
             form2: {
                 storeName: '',
@@ -85,7 +94,8 @@ export default {
                 email: '',
                 idNo: '',
                 idNoImage: '',
-                licenseImage: ''
+                licenseImage: '',
+                wxUsername: ''
             }
         };
     },

+ 49 - 1
src/pages/store/homePage.vue

@@ -310,7 +310,55 @@ export default {
             this.chooseIds = list;
         },
         startLive() {
-            this.navigateTo('/pages/store/liveProduct');
+            if (!this.userStoreInfo.wxUsername) {
+                wx.navigateTo({
+                    url: '/pages/changeText',
+                    success: res => {
+                        // success
+                        res.eventChannel.emit('message', this.userStoreInfo.wxUsername);
+                        res.eventChannel.emit('title', {
+                            title: '设置主播微信号',
+                            key: 'wxUsername'
+                        });
+                    }
+                });
+            } else {
+                this.$http
+                    .post('/store/findStoreCases', {
+                        storeId: this.storeInfo.id,
+                        caseStatuses: 'PROGRESS'
+                    })
+                    .then(res => {
+                        if (res.caseInfo.length > 0) {
+                            this.navigateTo('/pages/store/liveProduct');
+                        } else {
+                            wx.showModal({
+                                content: '当前无进行中商品,请先新增商品',
+                                confirmColor: this.$colors.prim,
+                                confirmText: '立即新增',
+                                cancelText: '下次再说',
+                                success: res => {
+                                    if (res.confirm) {
+                                        this.navigateTo('/pages/store/productEdit');
+                                    }
+                                }
+                            });
+                        }
+                    });
+            }
+        },
+        updateInfo(changeInfo = {}) {
+            let data = { ...this.userStoreInfo, ...changeInfo };
+            this.showLoading();
+            this.$http
+                .postJson('/store/save', data)
+                .then(res => {
+                    return this.$store.dispatch('getUserStore');
+                })
+                .then(() => {
+                    this.toast('设置成功', 'success');
+                    this.startLive();
+                });
         },
         scrollPage(e) {
             this.isFixed = e.detail.isFixed;

+ 46 - 5
src/pages/store/liveProduct.vue

@@ -36,7 +36,7 @@
 
         <div class="bottom">
             <block v-if="isStart">
-                <button-bg type="warning" @click="getPushUrl(true)">推流地址</button-bg>
+                <button-bg type="warning" @click="showCode = true">进入直播间</button-bg>
                 <button-bg type="prim" isRight @click="end">结束直播</button-bg>
             </block>
             <block v-else>
@@ -45,7 +45,7 @@
             </block>
         </div>
 
-        <van-popup :show="showUrl" @close="showUrl = false">
+        <!-- <van-popup :show="showUrl" @close="showUrl = false">
             <div class="url-box">
                 <div class="text1">直播间创建成功</div>
 
@@ -57,7 +57,38 @@
 
                 <van-button size="small" type="primary" @click="copy">一键复制</van-button>
             </div>
-        </van-popup>
+        </van-popup> -->
+        <van-dialog
+            use-slot
+            :show="showCode"
+            :show-cancel-button="!isStart"
+            cancel-button-text="返回"
+            :confirm-button-text="isStart ? '确认' : '认证成功'"
+            :confirm-button-color="$colors.prim"
+            @cancel="navigateBack"
+            @confirm="showCode = false"
+        >
+            <div class="url-box">
+                <div class="text1" style="text-align:center;max-width:220px">
+                    {{
+                        isStart ? '直播间创建成功扫描下方二维码进入直播间' : '开启直播前请先扫描下方二维码进行实名认证'
+                    }}
+                </div>
+                <img
+                    v-if="isStart"
+                    src="https://ticket-exchange.oss-cn-hangzhou.aliyuncs.com/wechat/6451622451530_.pic_hd.jpg"
+                    alt=""
+                    class="code-img"
+                />
+
+                <img
+                    v-else
+                    class="code-img"
+                    src="https://res.wx.qq.com/op_res/9rSix1dhHfK4rR049JL0PHJ7TpOvkuZ3mE0z7Ou_Etvjf-w1J_jVX0rZqeStLfwh"
+                    alt=""
+                />
+            </div>
+        </van-dialog>
     </div>
 </template>
 
@@ -75,6 +106,7 @@ export default {
             accessToken: '',
             isStart: false,
             showUrl: false,
+            showCode: false,
             path: 'plugin-private://wx2b03c6e691cd7370/pages/live-player-plugin?room_id=5'
         };
     },
@@ -88,8 +120,10 @@ export default {
                 });
                 this.getData();
                 // this.createRoom();
-                if (this.isStart) {
-                    this.getPushUrl(needShow);
+                if (this.isStart && !needShow) {
+                    this.showCode = false;
+                } else {
+                    this.showCode = true;
                 }
             });
         },
@@ -280,5 +314,12 @@ export default {
             color: @prim;
         }
     }
+
+    .code-img {
+        width: 200px;
+        height: 200px;
+        display: block;
+        margin-top: 20px;
+    }
 }
 </style>

+ 26 - 5
src/pages/store/setting.vue

@@ -9,10 +9,17 @@
             <van-cell title="LOGO" is-link @click="changeLogo" class="avatar">
                 <van-image round width="36" height="36" :src="storeLogo" fit="cover" />
             </van-cell>
-            <van-cell title="店铺名称" @click="goChange" :value="storeInfo ? storeInfo.storeName : ''" is-link />
-            <van-cell title="店铺地区" :border="false" is-link :class="{ not: !city }" @click="$refs.area.init()">
+            <van-cell title="店铺名称" @click="goChange(1)" :value="storeInfo ? storeInfo.storeName : ''" is-link />
+            <van-cell title="店铺地区" :class="{ not: !city }" @click="$refs.area.init()">
                 <span>{{ city || '未设置' }}</span>
             </van-cell>
+            <van-cell
+                title="主播微信号"
+                :border="false"
+                is-link
+                @click="goChange(2)"
+                :value="storeInfo ? storeInfo.wxUsername : ''"
+            />
         </van-cell-group>
 
         <area-select ref="area" :columnsNum="2" @input="changeCity"></area-select>
@@ -78,13 +85,27 @@ export default {
                     this.toast('更新成功', 'success');
                 });
         },
-        goChange() {
+        goChange(type) {
             wx.navigateTo({
                 url: '/pages/changeText',
                 success: res => {
                     // success
-                    res.eventChannel.emit('message', this.userStoreInfo.storeName);
-                    res.eventChannel.emit('title', '修改店铺名称');
+                    res.eventChannel.emit(
+                        'message',
+                        type === 1 ? this.userStoreInfo.storeName : this.userStoreInfo.wxUsername
+                    );
+                    res.eventChannel.emit(
+                        'title',
+                        type === 1
+                            ? {
+                                  title: '修改店铺名称',
+                                  key: 'storeName'
+                              }
+                            : {
+                                  title: '修改主播微信号',
+                                  key: 'wxUsername'
+                              }
+                    );
                 }
             });
         }