Browse Source

公告列表,看了下登陆的问题,应该是刷新token的问题,导致登陆进去无限弹出对话框

ltx529596 4 years ago
parent
commit
36dfcbf9e6

+ 1 - 0
src/App.vue

@@ -23,6 +23,7 @@
             initSystemInfo() {
                 uni.getSystemInfo({
                     success(e) {
+                        console.log(e);
                         // #ifndef MP
                         Vue.prototype.StatusBar = e.statusBarHeight;
                         if (e.platform == 'android') {

+ 53 - 7
src/pages/index/setting/notice.vue

@@ -2,14 +2,17 @@
 <template>
   <view class="notice">
     <Header :title="title"></Header>
+    <view class="btn-add">
+      <image src="../../../static/images/addicon.png" class="addicon" @tap="add"></image>
+    </view>
     <view style="height: 94upx;"></view>
     <view class="notice-content">
-      <view class="item">
+      <view class="item" v-for="item in noticeList" :key="item.id">
         <view class="notice-top">
-          <image src="" class="img"></image>
+          <image :src="item.icon" class="picture"></image>
           <view class="detail">
-            <text class="txt">景区公告</text>
-            <text class="time">2020-07-15</text>
+            <text class="txt">{{item.title}}</text>
+            <text class="time">{{item.time.substring(0,10)}}</text>
           </view>
         </view>
         <view class="notice-btns">
@@ -32,25 +35,68 @@ export default {
     //这里存放数据
     return {
       title: '公告管理',
+      params: {
+        mid: 53,
+        pageNo: 1,
+        pageSize: 10,
+        type: '1',
+      },
+      noticeList: []
     };
   },
+  onLoad () {
+    this.getShopMessage()
+    this.getNoticeList()
+  },
   //方法集合
-  methods: {},
+  methods: {
+    // 商家信息
+    async getShopMessage() {
+      await this.$http.get('/getUserInfo').then(async (res) => {
+        if (res.data) {
+          this.params.mid = res.data.id;
+        }
+      });
+    },
+    // 公告列表
+    async getNoticeList() {
+      await this.$http.post('/news/list', this.params).then(async (res)=>{
+        if (res.code === 200) {
+          this.noticeList = res.data.list
+          console.log(this.noticeList);
+        }
+      });
+    },
+    // 新增列表
+    add() {
+      console.log(1);
+    }
+  },
 };
 </script>
 <style lang='scss' scoped>
+.btn-add {
+  position: fixed;
+  right: 33upx;
+  top: 20upx;
+  z-index: 100;
+  .addicon {
+    width: 48upx;
+    height: 48upx;
+  }
+}
 .notice-content {
   background-color: #f4f4f4;
   padding: 15upx 33upx;
+ 
   .item {
     background-color: #fff;
     border-radius: 10upx;
     padding: 20upx;
     .notice-top {
-      .img {
+      .picture {
         width: 100%;
         height: 350upx;
-        background-color: pink;
         border-radius: 20upx;
       }
       .detail {

+ 4 - 4
src/pages/public/login.vue

@@ -186,10 +186,10 @@ export default {
     showLoginBySmsCode() {
       this.loginByPass = !this.loginByPass;
     },
-    // 返回上一页
-    navBack() {
-      this.$mRouter.back();
-    },
+    // // 返回上一页
+    // navBack() {
+    //   this.$mRouter.back();
+    // },
     // 统一跳转路由
     navTo() {
       this.$mRouter.redirectTo({ route: '/pages/public/resetpassword' });

+ 22 - 17
src/pages/shop/shop.vue

@@ -95,7 +95,7 @@
         <view class="operate">
           <view class="btn stick" id="one" @tap="sticktop(item.id)">置顶</view>
           <view class="btn sold" @tap="passGet(item.id)">审核</view>
-          <view class="btn compile" @tap="topage">编辑</view>
+          <view class="btn compile" @tap="topage(item)">编辑</view>
           <view class="btn delete" @tap="deleteshop(item.id)">删除</view>
         </view>
       </view>
@@ -128,7 +128,7 @@
         <view class="operate">
           <view class="btn stick" id="one" @tap="sticktop(item.id)">置顶</view>
           <view class="btn sold" @tap="shopPutDown(item.id)">下架</view>
-          <view class="btn compile" @tap="topage">编辑</view>
+          <view class="btn compile" @tap="topage(item)">编辑</view>
           <view class="btn delete" @tap="deleteshop(item.id)">删除</view>
         </view>
       </view>
@@ -161,7 +161,7 @@
         <view class="operate">
           <view class="btn stick" id="one" @tap="sticktop(item.id)">置顶</view>
           <view class="btn sold" @tap="shopPutUp(item.id)">上架</view>
-          <view class="btn compile" @tap="topage">编辑</view>
+          <view class="btn compile" @tap="topage(item)">编辑</view>
           <view class="btn delete" @tap="deleteshop(item.id)">删除</view>
         </view>
       </view>
@@ -239,7 +239,20 @@ export default {
     },
   },
   // 下拉刷新
-  onPullDownRefresh() {},
+  onPullDownRefresh() {
+    this.more = 'loading'
+    this.isactive = 1
+    this.params = {
+      pageNum: 1,
+      pageSize: 10,
+      mid: 0, // 景区id
+      status: '1', // 审核状态
+      upDown: '', // 上下架状态
+      shopId: '', // 商铺id 选择框
+      name: '',
+    };
+    this.getShopMessage();
+  },
   // 上拉加载
   onReachBottom() {
     if (this.soleStatus === 1) {
@@ -262,15 +275,12 @@ export default {
     },
     // 删除商品
     async deleteshop(id) {
-      this.deleteId = id
+      this.deleteId = id;
       this.masktxt = '是否删除该订单?';
       this.isShowMask = true;
-
-      return;
     },
     // 监听遮罩层行为
     isSureConver(e) {
-      console.log(e);
       if (e) {
         this.$http.delete('/goods/del/' + this.deleteId).then(async (res) => {
           if (res.code === 200 && res.msg === 'OK') {
@@ -288,7 +298,6 @@ export default {
       this.more = 'loading';
       this.params.pageNum = 1;
       this.getTicketShopList();
-      console.log(this.params.name);
     },
     // 选择商铺
     bindPickerChange(e) {
@@ -297,7 +306,6 @@ export default {
       this.shopID = null;
       this.index = e.detail.value;
       this.params.shopId = this.shopArray[this.index].id;
-      console.log(this.params.shopId);
       this.getTicketShopList();
     },
     // 获取店铺列表
@@ -342,20 +350,16 @@ export default {
     },
     // 置顶
     sticktop(id) {
-      console.log(id);
       this.$http.PUT('/goods/changeSort?id=' + id + '&sort=-1').then((res) => {
-        console.log(res);
         if (res.code === 200) {
           this.getTicketShopList();
         }
       });
     },
     // 跳转详情
-    topage() {
-      console.log(1);
-      this.$mRouter.push({
-        route: '/pages/shop/shopdetail',
-      });
+    topage(data) {
+      uni.setStorageSync('shopData', data);
+      this.$mRouter.push({ route: '/pages/shop/shopdetail' });
     },
     // 商品列表(待审核状态)
     async getTicketShopList() {
@@ -369,6 +373,7 @@ export default {
         delete this.params.upDown;
       }
       await this.$http.get('/goods/list', this.params).then((res) => {
+        console.log(res);
         if (res.data.list.length > 0) {
           this.shoplist = res.data.list;
           console.log(this.shoplist);

+ 7 - 4
src/pages/shop/shopdetail.vue

@@ -225,9 +225,16 @@ export default {
       pickList: [],
       Icon: '',
       Imglist: [],
+
+      // -------------- 编辑分界线 ------------------------------------
+
+      shopData: uni.getStorageSync('shopData'),  // 携带的编辑信息
+      
     };
   },
   onLoad() {
+    console.log('编辑');
+    console.log(this.shopData);
     // 初始化阿里云
     myCloud = uniCloud.init({
       provider: 'aliyun',
@@ -449,10 +456,6 @@ export default {
     saveTxt(e) {
       this.mastKnow = e.detail.html;
     },
-    // 清空富文本
-    // undo() {
-    //   this.editorCtx.undo();
-    // },
     // 内容提交
     submitMesage() {
       let _this = this;

BIN
src/static/arc.png


BIN
src/static/distribution.png


BIN
src/static/errorImage.jpg


BIN
src/static/kj.png


BIN
src/static/logo.png


BIN
src/static/news.png


BIN
src/static/noNetWork.png


BIN
src/static/notFound.png


BIN
src/static/pinkage.png


BIN
src/static/presale.png


BIN
src/static/share-bg.png


BIN
src/static/tab-cart-current.png


BIN
src/static/tab-cart.png


BIN
src/static/tab-cate-current.png


BIN
src/static/tab-cate.png


BIN
src/static/tab-home-current.png


BIN
src/static/tab-home.png


BIN
src/static/tab-my-current.png


BIN
src/static/tab-my.png


BIN
src/static/tab-notify-current.png


BIN
src/static/tab-notify.png


BIN
src/static/tg.png


BIN
src/static/upgrade-top.png


BIN
src/static/user-bg.jpg


BIN
src/static/user_bg.png


BIN
src/static/vip-card-bg.png


BIN
src/static/vip-card.png


BIN
src/static/vip-price.png


BIN
src/static/virtual.png


BIN
src/static/yticon.ttf


BIN
src/static/zk.png