panhui 4 лет назад
Родитель
Сommit
e7d2f32e07

+ 1 - 1
.env.development

@@ -1 +1 @@
-VUE_APP_BASE_URL=http://192.168.50.212:8080
+VUE_APP_BASE_URL=http://localhost:8080

+ 183 - 183
project.private.config.json

@@ -1,186 +1,186 @@
 {
-    "setting": {},
-    "condition": {
-        "plugin": {
-            "list": []
-        },
-        "game": {
-            "list": []
-        },
-        "gamePlugin": {
-            "list": []
-        },
-        "miniprogram": {
-            "list": [
-                {
-                    "id": -1,
-                    "name": "消息",
-                    "pathName": "/pages/news",
-                    "query": "",
-                    "scene": null
-                },
-                {
-                    "id": -1,
-                    "name": "聊天页面",
-                    "pathName": "/pages/chat",
-                    "query": "toUserId=1&toName=官方店铺",
-                    "scene": null
-                },
-                {
-                    "id": -1,
-                    "name": "我的",
-                    "pathName": "/pages/mine",
-                    "query": "",
-                    "scene": null
-                },
-                {
-                    "id": -1,
-                    "name": "我的收藏",
-                    "pathName": "/pages/mineFollow",
-                    "query": "",
-                    "scene": null
-                },
-                {
-                    "id": -1,
-                    "name": "个人设置",
-                    "pathName": "/pages/setting",
-                    "query": "",
-                    "scene": null
-                },
-                {
-                    "id": -1,
-                    "name": "我的钱包",
-                    "pathName": "/pages/wallet",
-                    "query": "",
-                    "scene": null
-                },
-                {
-                    "id": -1,
-                    "name": "授权登陆",
-                    "pathName": "/pages/authorized",
-                    "query": "",
-                    "scene": null
-                },
-                {
-                    "id": -1,
-                    "name": "常见问题",
-                    "pathName": "/pages/questions",
-                    "query": "",
-                    "scene": null
-                },
-                {
-                    "id": -1,
-                    "name": "选择地址",
-                    "pathName": "/pages/chooseAddress",
-                    "query": "",
-                    "scene": null
-                },
-                {
-                    "id": -1,
-                    "name": "订单详情",
-                    "pathName": "/pages/orderdetails",
-                    "query": "id=779"
-                },
-                {
-                    "id": -1,
-                    "name": "新增地址",
-                    "pathName": "/pages/receiving",
-                    "query": "",
-                    "scene": null
-                },
-                {
-                    "id": -1,
-                    "name": "首页",
-                    "pathName": "/pages/Home",
-                    "query": "",
-                    "scene": null
-                },
-                {
-                    "name": "拼箱详情",
-                    "pathName": "/pages/details",
-                    "query": "id=2570",
-                    "scene": null
-                },
-                {
-                    "id": -1,
-                    "name": "收货地址",
-                    "pathName": "/pages/address",
-                    "query": "",
-                    "scene": null
-                },
-                {
-                    "id": -1,
-                    "name": "确认订单",
-                    "pathName": "/pages/confirmorder",
-                    "query": "caseId=2248&boxIds=2251%2C2257%2C2275%2C2281",
-                    "scene": null
-                },
-                {
-                    "id": -1,
-                    "name": "我买到的",
-                    "pathName": "/pages/allorder",
-                    "query": "",
-                    "scene": null
-                },
-                {
-                    "id": -1,
-                    "name": "店铺申请",
-                    "pathName": "/pages/store/apply",
-                    "query": "",
-                    "scene": null
-                },
-                {
-                    "id": -1,
-                    "name": "认证审核进度",
-                    "pathName": "/pages/store/review",
-                    "query": "",
-                    "scene": null
-                },
-                {
-                    "name": "店铺首页",
-                    "pathName": "/pages/store/homePage",
-                    "query": "",
-                    "scene": null
-                },
-                {
-                    "name": "直播商品",
-                    "pathName": "/pages/store/liveProduct",
-                    "query": "",
-                    "scene": null
-                },
-                {
-                    "id": -1,
-                    "name": "申请退款",
-                    "pathName": "/pages/Apply",
-                    "query": "",
-                    "scene": null
-                },
-                {
-                    "id": -1,
-                    "name": "退款详情",
-                    "pathName": "/pages/Applydetails",
-                    "query": "",
-                    "scene": null
-                },
-                {
-                    "name": "我卖出的",
-                    "pathName": "pages/allsellout",
-                    "query": "null",
-                    "scene": null
-                },
-                {
-                    "name": "新增商品",
-                    "pathName": "pages/store/productEdit",
-                    "query": "null",
-                    "scene": null
-                },
-                {
-                    "name": "管理商品",
-                    "pathName": "pages/store/administration",
-                    "query": "null",
-                    "scene": null
-                }
-            ]
+  "setting": {},
+  "condition": {
+    "plugin": {
+      "list": []
+    },
+    "game": {
+      "list": []
+    },
+    "gamePlugin": {
+      "list": []
+    },
+    "miniprogram": {
+      "list": [
+        {
+          "id": -1,
+          "name": "消息",
+          "pathName": "/pages/news",
+          "query": "",
+          "scene": null
+        },
+        {
+          "id": -1,
+          "name": "聊天页面",
+          "pathName": "/pages/chat",
+          "query": "toUserId=1&toName=官方店铺",
+          "scene": null
+        },
+        {
+          "id": -1,
+          "name": "我的",
+          "pathName": "/pages/mine",
+          "query": "",
+          "scene": null
+        },
+        {
+          "id": -1,
+          "name": "我的收藏",
+          "pathName": "/pages/mineFollow",
+          "query": "",
+          "scene": null
+        },
+        {
+          "id": -1,
+          "name": "个人设置",
+          "pathName": "/pages/setting",
+          "query": "",
+          "scene": null
+        },
+        {
+          "id": -1,
+          "name": "我的钱包",
+          "pathName": "/pages/wallet",
+          "query": "",
+          "scene": null
+        },
+        {
+          "id": -1,
+          "name": "授权登陆",
+          "pathName": "/pages/authorized",
+          "query": "",
+          "scene": null
+        },
+        {
+          "id": -1,
+          "name": "常见问题",
+          "pathName": "/pages/questions",
+          "query": "",
+          "scene": null
+        },
+        {
+          "id": -1,
+          "name": "选择地址",
+          "pathName": "/pages/chooseAddress",
+          "query": "",
+          "scene": null
+        },
+        {
+          "id": -1,
+          "name": "订单详情",
+          "pathName": "/pages/orderdetails",
+          "query": "id=779"
+        },
+        {
+          "id": -1,
+          "name": "新增地址",
+          "pathName": "/pages/receiving",
+          "query": "",
+          "scene": null
+        },
+        {
+          "id": -1,
+          "name": "首页",
+          "pathName": "/pages/Home",
+          "query": "",
+          "scene": null
+        },
+        {
+          "name": "拼箱详情",
+          "pathName": "/pages/details",
+          "query": "id=2570",
+          "scene": null
+        },
+        {
+          "id": -1,
+          "name": "收货地址",
+          "pathName": "/pages/address",
+          "query": "",
+          "scene": null
+        },
+        {
+          "id": -1,
+          "name": "确认订单",
+          "pathName": "/pages/confirmorder",
+          "query": "caseId=2248&boxIds=2251%2C2257%2C2275%2C2281",
+          "scene": null
+        },
+        {
+          "id": -1,
+          "name": "我买到的",
+          "pathName": "/pages/allorder",
+          "query": "",
+          "scene": null
+        },
+        {
+          "id": -1,
+          "name": "店铺申请",
+          "pathName": "/pages/store/apply",
+          "query": "",
+          "scene": null
+        },
+        {
+          "id": -1,
+          "name": "认证审核进度",
+          "pathName": "/pages/store/review",
+          "query": "",
+          "scene": null
+        },
+        {
+          "name": "店铺首页",
+          "pathName": "/pages/store/homePage",
+          "query": "",
+          "scene": null
+        },
+        {
+          "name": "直播商品",
+          "pathName": "/pages/store/liveProduct",
+          "query": "",
+          "scene": null
+        },
+        {
+          "id": -1,
+          "name": "申请退款",
+          "pathName": "/pages/Apply",
+          "query": "",
+          "scene": null
+        },
+        {
+          "id": -1,
+          "name": "退款详情",
+          "pathName": "/pages/Applydetails",
+          "query": "",
+          "scene": null
+        },
+        {
+          "name": "我卖出的",
+          "pathName": "pages/allsellout",
+          "query": "null",
+          "scene": null
+        },
+        {
+          "name": "新增商品",
+          "pathName": "pages/store/productEdit",
+          "query": "null",
+          "scene": null
+        },
+        {
+          "name": "管理商品",
+          "pathName": "pages/store/administration",
+          "query": "null",
+          "scene": null
         }
+      ]
     }
-}
+  }
+}

+ 1 - 1
src/components/ProductInfo.vue

@@ -29,7 +29,7 @@
             </div>
         </div>
 
-        <div class="live" v-if="!isMine">
+        <div class="live" v-if="!isMine && info.liveNow">
             <img src="/native/svgs/icon_kapai_zhibo.svg" alt="" />
             <span>直播</span>
         </div>

+ 1 - 1
src/mixins/cardPage.js

@@ -20,7 +20,7 @@ export default {
                 },
                 {
                     value: 'FINISH',
-                    label: '已结束'
+                    label: '已开箱'
                 }
             ]
         };

+ 7 - 0
src/mixins/common.js

@@ -123,6 +123,13 @@ export default {
         },
         getLogo(img) {
             return img ? img + '?x-oss-process=image/circle,r_300/format,png' : '/native/imgs/defaultLogo.png';
+        },
+        goInLive(roomId) {
+            if (roomId) {
+                wx.navigateTo({
+                    url: `plugin-private://wx2b03c6e691cd7370/pages/live-player-plugin?room_id=${roomId}`
+                });
+            }
         }
     }
 };

+ 1 - 5
src/pages/Home.vue

@@ -90,7 +90,7 @@ export default {
             search: '',
             active: '进行中',
             list: [],
-            tabs: ['进行中', '已完成', '已过期'],
+            tabs: ['进行中', '已完成', '已开箱'],
             empty: false,
             collectionId: 0,
             seriesId: 0,
@@ -156,7 +156,6 @@ export default {
                 .get('/cardCase/showCasesMA', data)
                 .then(res => {
                     this.hideLoading();
-                    console.log(res);
                     this.list = res;
                     if (res.length === 0) {
                         this.empty = true;
@@ -182,13 +181,10 @@ export default {
                     }
                 )
                 .then(res => {
-                    this.hideLoading();
                     console.log(res);
                     this.columns = res.content;
-                    console.log(this.columns);
                 })
                 .catch(e => {
-                    this.hideLoading();
                     if (e.error) {
                         this.toast(e.rror);
                     }

+ 20 - 2
src/pages/details.vue

@@ -13,9 +13,9 @@
         </swiper>
         <div class="box-tit">{{ cardCaseInfo.caseName }}</div>
 
-        <div class="box-live" @click="wait">
+        <div class="box-live" @click="live">
             <img src="https://ticket-exchange.oss-cn-hangzhou.aliyuncs.com/wechat/icon_kapai_zhibo@3x.png" alt="" />
-            <p>直播未开始</p>
+            <p>{{ liveStatus }}</p>
         </div>
         <div class="money-content">
             <div class="box-money">
@@ -121,6 +121,17 @@ export default {
             } else {
                 return 0;
             }
+        },
+        liveStatus() {
+            if (this.cardCaseInfo.roomId) {
+                if (this.cardCaseInfo.roomId !== this.storeInfo.roomId || !this.storeInfo.liveNow) {
+                    return '直播回放';
+                } else {
+                    return '正在直播';
+                }
+            } else {
+                return '直播未开始';
+            }
         }
     },
     methods: {
@@ -178,6 +189,13 @@ export default {
                     this.toast('此商品是你店铺所有');
                 }
             });
+        },
+        live() {
+            if (this.cardCaseInfo.roomId) {
+                this.goInLive(this.cardCaseInfo.roomId);
+            } else {
+                this.toast('直播未开始');
+            }
         }
     },
     onShow() {

+ 68 - 28
src/pages/store/homePage.vue

@@ -11,7 +11,7 @@
 <template>
     <div>
         <nav-header>{{ isMineShop ? '我的店铺' : storeInfo.storeName }}</nav-header>
-        <div class="top">
+        <div class="top" id="top">
             <van-image
                 width="100%"
                 src="https://ticket-exchange.oss-cn-hangzhou.aliyuncs.com/wechat/info_top_bg.png"
@@ -26,13 +26,29 @@
                     <span>{{ city }}</span>
                 </div>
             </div>
-            <van-button type="primary" @click="startLive" class="live" v-if="isMineShop">
+            <van-button
+                type="primary"
+                v-if="isMineShop"
+                :style="{ top: isFixed ? '20%' : '50%' }"
+                @click="startLive"
+                class="live-btn"
+            >
                 <img src="/native/svgs/icon_kapai_zhibo.svg" alt="" />
-                开启直播
+                <span v-if="!isFixed">{{ storeInfo.liveNow ? '正在直播中' : '开启直播' }}</span>
+            </van-button>
+            <van-button
+                type="primary"
+                v-else-if="storeInfo.liveNow"
+                :style="{ top: isFixed ? '20%' : '50%' }"
+                @click="goInLive(storeInfo.roomId)"
+                class="live-btn"
+            >
+                <img src="/native/svgs/icon_kapai_zhibo.svg" alt="" />
+                <span v-if="!isFixed">{{ storeInfo.liveNow ? '看直播' : '' }}</span>
             </van-button>
         </div>
         <div class="list">
-            <van-sticky :offset-top="offsetTop">
+            <van-sticky :offset-top="offsetTop" @scroll="scrollPage">
                 <div class="list-header">
                     <div class="col-3">
                         <van-dropdown-menu>
@@ -45,14 +61,14 @@
                         </van-dropdown-menu>
                     </div>
                     <div class="col-3">
-                        <sort-item v-model="sort" @input="getData" name="boxPrice">价格</sort-item>
+                        <sort-item v-model="sort" @input="sortChange" name="boxPrice">价格</sort-item>
                     </div>
                     <div class="col-3">
-                        <sort-item v-model="sort" @input="getData" name="id">最新</sort-item>
+                        <sort-item v-model="sort" @input="sortChange" name="id">最新</sort-item>
                     </div>
                 </div>
             </van-sticky>
-            <div class="list-content">
+            <div class="list-content" :style="{ minHeight: `calc(100vh - 139px - ${offsetTop}px)` }">
                 <div class="procuct" v-for="(item, index) in list" :key="index">
                     <van-icon
                         @click="choose(item.cardCaseId)"
@@ -62,13 +78,15 @@
                         :name="checkChoose(item.cardCaseId) ? 'checked' : 'circle'"
                         size="18px"
                     />
-                    <product-info
-                        :info="item"
-                        :isMine="isMineShop"
-                        :startChoose="isManage"
-                        :showBtn="isManage"
-                        @choose="choose"
-                    ></product-info>
+                    <div class="product-content">
+                        <product-info
+                            :info="item"
+                            :isMine="isMineShop"
+                            :startChoose="isManage"
+                            :showBtn="isManage"
+                            @choose="choose"
+                        ></product-info>
+                    </div>
                 </div>
                 <van-empty
                     v-if="empty"
@@ -111,7 +129,7 @@ export default {
     mixins: [store, cardPage],
     data() {
         return {
-            caseStatus: '',
+            caseStatus: 'PROGRESS',
             sort: '',
             page: 0,
             loading: false,
@@ -125,7 +143,9 @@ export default {
             showImg: false,
             imgInfo: {
                 url: ''
-            }
+            },
+            isFixed: false,
+            fixedTop: 0
         };
     },
     computed: {
@@ -162,6 +182,15 @@ export default {
                 this.getData();
                 setTimeout(() => {
                     this.offsetTop = this.systemInfo.statusBarHeight + 44;
+                    if (!this.fixedTop) {
+                        wx.createSelectorQuery()
+                            .select('#top')
+                            .boundingClientRect(rect => {
+                                this.fixedTop = rect.height - 44 + 5;
+                                console.log(this.fixedTop);
+                            })
+                            .exec();
+                    }
                 }, 1000);
             });
         },
@@ -194,6 +223,11 @@ export default {
             console.log(value);
             this.caseStatus = value.detail;
             this.sort = '';
+            this.needChange = true;
+            this.getData();
+        },
+        sortChange() {
+            this.needChange = true;
             this.getData();
         },
         getData() {
@@ -224,6 +258,16 @@ export default {
                     this.empty = true;
                 }
                 this.hideLoading();
+
+                this.$nextTick(() => {
+                    if (this.needChange) {
+                        wx.pageScrollTo({
+                            scrollTop: this.fixedTop
+                        });
+                        this.needChange = false;
+                    }
+                });
+
                 return Promise.resolve();
             });
         },
@@ -264,16 +308,10 @@ export default {
             this.chooseIds = list;
         },
         startLive() {
-            this.$http
-                .post('/live/applyAnchor', {
-                    wxUsername: 'w1529378564'
-                })
-                .then(res => {
-                    this.showImg = true;
-                    this.imgInfo = {
-                        url: res.codeurl
-                    };
-                });
+            this.navigateTo('/pages/store/liveProduct');
+        },
+        scrollPage(e) {
+            this.isFixed = e.detail.isFixed;
         }
     },
     onPageScroll() {},
@@ -395,7 +433,7 @@ export default {
 
     .flex();
 
-    .product-card {
+    .product-content {
         flex-grow: 1;
     }
 
@@ -404,15 +442,17 @@ export default {
     }
 }
 
-/deep/.live {
+/deep/.live-btn {
     position: fixed;
     right: 0;
     top: 50%;
+    transition: top ease-in-out 0.3s;
 
     .van-button {
         --button-default-height: 36px;
         --button-line-height: 36px;
         --button-border-radius: 18px 0px 0px 18px;
+        box-shadow: 0px -4px 8px 0px rgba(0, 0, 0, 0.04);
 
         img {
             width: 18px;

+ 174 - 24
src/pages/store/liveProduct.vue

@@ -1,22 +1,32 @@
 <config>
 {
-    "navigationBarTitleText": "选择直播商品",
+    "navigationBarTitleText": "",
     "navigationBarBackgroundColor": "#ffffff",
     "navigationBarTextStyle": "black"
 }
 </config>
 <template>
     <div class="list">
-        <div class="procuct" v-for="(item, index) in list" :key="index">
-            <van-icon
-                @click="choose(item.cardCaseId)"
-                :color="checkChoose(item.cardCaseId) ? $colors.prim : '#C8C9CC'"
-                class="check"
-                :name="checkChoose(item.cardCaseId) ? 'checked' : 'circle'"
-                size="18px"
-            />
-            <product-info :info="item" isMine :showBtn="false" startChoose @choose="choose"></product-info>
-        </div>
+        <block v-if="isStart">
+            <!-- <div class="page-title">直播商品列表</div> -->
+            <div class="procuct" v-for="(item, index) in list" :key="index">
+                <product-info :info="item" :showBtn="false" startChoose></product-info>
+            </div>
+        </block>
+        <block v-else>
+            <div class="procuct" v-for="(item, index) in list" :key="index">
+                <van-icon
+                    @click="choose(item.cardCaseId)"
+                    :color="checkChoose(item.cardCaseId) ? $colors.prim : '#C8C9CC'"
+                    class="check"
+                    :name="checkChoose(item.cardCaseId) ? 'checked' : 'circle'"
+                    size="18px"
+                />
+                <div class="product-content">
+                    <product-info :info="item" isMine :showBtn="false" startChoose @choose="choose"></product-info>
+                </div>
+            </div>
+        </block>
         <van-empty
             v-if="empty"
             image="https://ticket-exchange.oss-cn-hangzhou.aliyuncs.com/wechat/kong_png_wukabao.png"
@@ -25,9 +35,29 @@
         </van-empty>
 
         <div class="bottom">
-            <button-bg type="warning">全选</button-bg>
-            <button-bg type="prim" isRight :disabled="chooseIds.length === 0" @click="start">确认开启</button-bg>
+            <block v-if="isStart">
+                <button-bg type="warning" @click="getPushUrl(true)">推流地址</button-bg>
+                <button-bg type="prim" isRight @click="end">结束直播</button-bg>
+            </block>
+            <block v-else>
+                <button-bg type="warning" @click="chooseAll">全选</button-bg>
+                <button-bg type="prim" isRight :disabled="chooseIds.length === 0" @click="start">确认开启</button-bg>
+            </block>
         </div>
+
+        <van-popup :show="showUrl" @close="showUrl = false">
+            <div class="url-box">
+                <div class="text1">直播间创建成功</div>
+
+                <div class="text2">
+                    您的推流地址为:
+                    <span class="active">{{ path }}</span
+                    >,请复制地址打开推流服务器开始直播。
+                </div>
+
+                <van-button size="small" type="primary" @click="copy">一键复制</van-button>
+            </div>
+        </van-popup>
     </div>
 </template>
 
@@ -41,28 +71,90 @@ export default {
             list: [],
             chooseIds: [],
             storeInfo: {},
-            empty: false
+            empty: false,
+            accessToken: '',
+            isStart: false,
+            showUrl: false,
+            path: 'plugin-private://wx2b03c6e691cd7370/pages/live-player-plugin?room_id=5'
         };
     },
     methods: {
-        loginMethods() {
+        loginMethods(needShow = false) {
             this.$store.dispatch('getUserStore').then(res => {
                 this.storeInfo = res;
+                this.isStart = res.liveNow;
+                wx.setNavigationBarTitle({
+                    title: res.liveNow ? '直播详情' : '选择直播商品'
+                });
                 this.getData();
+                // this.createRoom();
+                if (this.isStart) {
+                    this.getPushUrl(needShow);
+                }
+            });
+        },
+        getPushUrl(needShow = false) {
+            this.showLoading();
+            this.$http
+                .post('/live/getPushUrl', {
+                    roomId: this.storeInfo.roomId
+                })
+                .then(res => {
+                    this.hideLoading();
+                    this.path = res.pushAddr;
+                    this.showUrl = needShow;
+                });
+        },
+        goIn() {
+            wx.navigateTo({
+                url: `plugin-private://wx2b03c6e691cd7370/pages/live-player-plugin?room_id=5`
             });
         },
         start() {
             this.$http
                 .post('/live/createRoom', {
-                    cardCaseId: '7638'
+                    caseIdsStr: this.chooseIds.join(','),
+                    storeId: this.storeInfo.id
                 })
                 .then(res => {
-                    this.showImg = true;
-                    this.imgInfo = {
-                        url: res.codeurl
-                    };
+                    if (res.roomId) {
+                        this.loginMethods(true);
+                    }
+                    // this.showImg = true;
+                    // this.imgInfo = {
+                    //     url: res.codeurl
+                    // };
                 });
         },
+        end() {
+            wx.showModal({
+                content: '确定要关闭直播吗?',
+                confirmColor: this.$colors.prim,
+                success: res => {
+                    if (res.confirm) {
+                        this.$http
+                            .post('/live/closeLive', {
+                                storeId: this.storeInfo.id
+                            })
+                            .then(res => {
+                                this.toast('本次直播已结束', 'success');
+                                setTimeout(() => {
+                                    this.navigateBack();
+                                }, 1000);
+                            });
+                    }
+                }
+            });
+        },
+        chooseAll() {
+            if (this.chooseIds.length === this.list.length) {
+                this.chooseIds = [];
+            } else {
+                this.chooseIds = [...this.list].map(item => {
+                    return item.cardCaseId;
+                });
+            }
+        },
         checkChoose(id) {
             let list = [...this.chooseIds];
             return list.includes(id);
@@ -82,11 +174,23 @@ export default {
             let data = {
                 storeId: this.storeInfo.id
             };
-            data.caseStatuses = 'PROGRESS';
-            if (this.sort) {
-                data.sortStr = this.sort;
+            if (this.isStart) {
+                data.roomId = this.storeInfo.roomId;
+            } else {
+                data.caseStatuses = 'PROGRESS';
             }
             this.showLoading();
+            if (this.isStart) {
+                return this.$http.get('/cardCase/showRoomCases', data).then(res => {
+                    this.list = res;
+                    if (res.length == 0) {
+                        this.empty = true;
+                    }
+                    this.hideLoading();
+                    return Promise.resolve();
+                });
+            }
+
             return this.$http.post('/store/findStoreCases', data).then(res => {
                 this.list = res.caseInfo;
                 if (res.caseInfo.length == 0) {
@@ -95,6 +199,14 @@ export default {
                 this.hideLoading();
                 return Promise.resolve();
             });
+        },
+        copy() {
+            wx.setClipboardData({
+                data: this.path,
+                success: res => {
+                    this.showUrl = false;
+                }
+            });
         }
     }
 };
@@ -109,7 +221,7 @@ export default {
 
     .flex();
 
-    .product-card {
+    .product-content {
         flex-grow: 1;
     }
 
@@ -130,4 +242,42 @@ export default {
     justify-content: space-between;
     z-index: 20;
 }
+
+.page-title {
+    padding: 20px;
+    text-align: center;
+    font-size: 12px;
+    color: @text2;
+}
+/deep/.van-popup {
+    --popup-background-color: #ffffff00;
+}
+.url-box {
+    background: #ffffff;
+    border-radius: 12px;
+    padding: 30px 20px;
+    .flex-col();
+    align-items: center;
+    .text1 {
+        font-size: 16px;
+        font-weight: bold;
+        color: #000000;
+        line-height: 22px;
+    }
+
+    .text2 {
+        font-size: 13px;
+        font-family: PingFangSC-Medium, PingFang SC;
+        font-weight: 500;
+        color: #1a1a1a;
+        line-height: 18px;
+        padding: 25px 0;
+        word-break: break-all;
+        width: 250px;
+
+        .active {
+            color: @prim;
+        }
+    }
+}
 </style>

+ 8 - 6
src/pages/store/productEdit.vue

@@ -48,7 +48,7 @@
         </van-cell-group>
         <div class="box-con">
             <div class="label">卡牌细节图</div>
-            <van-uploader :file-list="images" :after-read="afterRead" @delete="deleteImg(images)" />
+            <van-uploader :file-list="images" :after-read="afterRead" @delete="deleteImg" />
             <div v-if="!showId">
                 <div class="box-top">
                     <div class="top">
@@ -400,10 +400,10 @@ export default {
                     });
                 });
         },
-        deleteImg(info) {
-            // console.log(info);
-            console.log(info);
-            this.images.splice(0, 1);
+        deleteImg(e) {
+            let list = [...this.images];
+            list.splice(e.detail.index, 1);
+            this.images = list;
         },
         submit() {
             if (!this.name) {
@@ -474,7 +474,9 @@ export default {
                     wx.showToast({
                         title: '商品上架成功'
                     });
-                    this.navigateTo('/pages/store/homePage');
+                    setTimeout(() => {
+                        this.navigateBack();
+                    }, 1000);
                     // if (this.showId) {
                     //     this.navigateTo('/pages/store/homePage');
                     // } else {