ltx529596 4 年之前
父节点
当前提交
9a98a8a46e
共有 4 个文件被更改,包括 21 次插入27 次删除
  1. 2 2
      src/config/index.config.js
  2. 0 1
      src/pages/index/setting/editnotice.vue
  3. 5 4
      src/pages/shop/shop.vue
  4. 14 20
      src/pages/shop/shopdetail.vue

+ 2 - 2
src/config/index.config.js

@@ -2,8 +2,8 @@ const CONFIG = {
     //开发环境配置
     development: {
         assetsPath: '/static', // 静态资源路径
-        // baseUrl: 'http://tyou.xiudo.cn/merch',  // 后台接口请求地址
-        baseUrl: 'http://192.168.100.135:83/merch',  // 后台接口请求地址
+        baseUrl: 'http://tyou.xiudo.cn/merch',  // 后台接口请求地址
+        // baseUrl: 'http://192.168.100.135:83/merch',  // 后台接口请求地址
         hostUrl: 'http://localhost:8080',        // H5地址(前端运行地址)
         websocketUrl: '',        // websocket服务端地址
         weixinAppId: '' // 微信公众号appid

+ 0 - 1
src/pages/index/setting/editnotice.vue

@@ -105,7 +105,6 @@ export default {
   },
   onLoad(option) {
     this.newid = option.id;
-    console.log(this.newid);
     this.getShopMessage();
     if (this.newid === 'add') {
       this.title = '添加公告';

+ 5 - 4
src/pages/shop/shop.vue

@@ -283,10 +283,11 @@ export default {
   methods: {
     // 跳转详情
     topage(id) {
-      if (id) {
-        uni.setStorageSync('Id', id);
-      }
-      this.$mRouter.push({ route: '/pages/shop/shopdetail' });
+      
+      // if (id) {
+      //   uni.setStorageSync('Id', id);
+      // }
+      this.$mRouter.push({ route: '/pages/shop/shopdetail', query:{id: id}});
     },
     // 删除商品
     async deleteshop(id) {

+ 14 - 20
src/pages/shop/shopdetail.vue

@@ -433,11 +433,7 @@ export default {
 
       // 商品库存
       shopNumList: [
-        {
-          id: '0',
-          name: '无限库存模式',
-          know: '售卖商品不计算库存,无限售卖。',
-        },
+        {id: '0',name: '无限库存模式',know: '售卖商品不计算库存,无限售卖。'},
         { id: '1', name: '限日库存模式', know: '每日固定库存售卖。' },
         { id: '2', name: '限总库存模式', know: '总库存限制,卖完为止。' },
       ],
@@ -478,9 +474,9 @@ export default {
     uni.removeStorageSync('Id');
   },
   onShow () {
-    // if (this.storeId != '') {
-    //   this.getLine(this.storeId)
-    // }
+    if (this.storeId != '') {
+      this.getLine(this.storeId)
+    }
   },
   onReady () {
     myCloud = uniCloud.init({
@@ -489,11 +485,11 @@ export default {
       clientSecret: '8nOzV70edtpCd0El6qce3g==',
     });
   },
-  onLoad () {
-    this.SHOPID = uni.getStorageSync('Id');
-
-    if (this.SHOPID) {
-      this.getShopBuyId(this.SHOPID).then(() => {
+  onLoad ( option ) {
+    
+    if (option.id != 'undefined') {
+      this.SHOPID = option.id
+      this.getShopBuyId(option.id).then(() => {
         this.getShopList().then(() => {
           this.getShopName(this.typeId, this.storeId);
         });
@@ -601,6 +597,7 @@ export default {
     },
     // 库存模式
     shopNumChange (e) {
+      console.log(e);
       for (let i = 0; i < this.shopNumList.length; i++) {
         if (this.shopNumList[i].id === e.target.value) {
           this.shopNumIndex = i;
@@ -614,6 +611,7 @@ export default {
       if (e.detail.value === '2') {
         this.dateInventory = 0;
       }
+
       this.astrictDate.data.goodsStockFlag = e.detail.value;
     },
     // 可退模式
@@ -653,7 +651,6 @@ export default {
             html: this.shopData.describ, //this.EditGoodsDetail.content为赋值内容。
           });
         })
-        .exec();
     },
     // -----------------------------------------------------------------
     // 跳转到管理分类页面
@@ -933,6 +930,7 @@ export default {
     // 内容提交
     submitMesage () {
       let _this = this;
+
       // 判断是否限制账号购买
       if (this.showoperat) {
         this.showoperat = '1';
@@ -941,15 +939,12 @@ export default {
         this.astrictDate.data.saleDay = 0;
         this.astrictDate.data.saleNum = 0;
       }
-
       let name = '';
       if (this.typeProperty === 1) {
         name = this.shopList[this.shopIndex].name;
       } else if (this.typeProperty === 0) {
         name = this.shopname;
       }
-
-      console.log(name);
       if (!this.storeId) {
         this.$mHelper.toast('请选择所属商铺!');
         return;
@@ -958,17 +953,16 @@ export default {
         this.$mHelper.toast('请选择商品类型!');
         return;
       }
-
       if (!name) {
         this.$mHelper.toast('请选择商品名称或者输入商品名称!');
         return;
       }
-
-      if (this.typeProperty === '0') {
+      if (this.typeProperty === 0) {
         if (!this.lineId) {
           this.$mHelper.toast('请选择商品分类!');
           return;
         }
+
         if (!this.price) {
           this.$mHelper.toast('请输入商品卖价!');
           return;