From 00bf17838b496e6fcfed2e521f9c27f8f0e3e3c7 Mon Sep 17 00:00:00 2001
From: liukangdong <898885815@qq.com>
Date: 星期一, 05 八月 2024 18:38:20 +0800
Subject: [PATCH] ‘’

---
 wechat_staff/pages/store/index.js |   47 ++++++++++++++++++++++++++++++++++++-----------
 1 files changed, 36 insertions(+), 11 deletions(-)

diff --git a/wechat_staff/pages/store/index.js b/wechat_staff/pages/store/index.js
index 28f0871..e27fe20 100644
--- a/wechat_staff/pages/store/index.js
+++ b/wechat_staff/pages/store/index.js
@@ -1,4 +1,4 @@
-import { getShopDetail } from '../../api/index'
+import { getShopDetail,loadShopList } from '../../api/index'
 // pages/store/index.js
 Page({
 
@@ -7,7 +7,8 @@
    */
   data: {
       shopId: null,
-      shopInfo:{}
+      shopInfo:{},
+      shopList:[]
   },
 
   /**
@@ -15,14 +16,37 @@
    */
   onLoad(options) { 
     console.log(options.shopId)
-    this.setData({shopId:options.shopId})
+    // this.loadShopList()
+    // this.setData({shopId:options.shopId})
   },
-  getShopInfo(id){ 
-    
-    getShopDetail(id).then(res => {
+  loadShopList(params) {
+    loadShopList({}).then(res => { 
+      if(res.data &&res.data){
+        let t = '';
+        res.data.forEach(item => {
+          if(item.seqNameList && item.seqNameList.length){
+            let tindex =0;
+            item.seqNameList.forEach(element => {
+              if(tindex>0){
+                t =t+"銆�"
+              }           
+               t = t+ element;
+               tindex++;
+            });
+          } 
+          item.seqNameInfo = t;
+        }); 
+      }
+      this.setData({
+        shopList: res.data || []
+      })  
+    }) 
+  },
+  getShopInfo(id){  
+     getShopDetail(id).then(res => {
       if(res.data && res.data.seqNameList){
-        const t = '';
-        const tindex =0;
+        let t = '';
+        let tindex =0;
         res.data.seqNameList.array.forEach(element => {
           if(tindex>0){
             t =t+"銆�"
@@ -38,8 +62,8 @@
     }) 
   },
   handleEdit(e) {
-    const {shopInfo} = this.data
-    const objString = JSON.stringify(shopInfo);
+    // const {shopInfo} = this.data
+    const objString = JSON.stringify(e.target.dataset.index);
     console.log(objString) 
     wx.navigateTo({
       url: '/pages/store/info?data='+objString ,
@@ -56,7 +80,8 @@
    * 鐢熷懡鍛ㄦ湡鍑芥暟--鐩戝惉椤甸潰鏄剧ず
    */
   onShow() { 
-    this.getShopInfo(this.data.shopId)
+    // this.getShopInfo(this.data.shopId)
+    this.loadShopList()
   },
 
   /**

--
Gitblit v1.9.3