xcx 4 vuotta sitten
vanhempi
commit
fcc73d8b8f

+ 24
- 0
src/pages/index/DaLeTouDingDan/index.vue Näytä tiedosto

@@ -57,6 +57,18 @@
57 57
 
58 58
         <div class="Layer" v-if="ShowStore">
59 59
           <div class="centerLabel">
60
+            <span v-if="MyStoreList.length">我的店铺:</span>
61
+            <ul v-if="MyStoreList.length">
62
+              <li v-for="(item, index) in MyStoreList" :key="index" v-if="item.status - 0 === 1" class="flex-h" @click="SelectStore(item)">
63
+                <div class="flex-item">
64
+                  <div>
65
+                    <span>{{item.name}}</span>
66
+                  </div>
67
+                </div>
68
+                <i class="iconfont iconweigouxuan" v-if="item.shopId !== CurrentStoreId"></i>
69
+                <i class="iconfont iconyigouxuan active" v-else></i>
70
+              </li>
71
+            </ul>
60 72
             <span v-if="RecommendStoreList.length">推荐店铺:</span>
61 73
             <ul v-if="RecommendStoreList.length">
62 74
               <li v-for="(item, index) in RecommendStoreList" :key="index" v-if="item.status - 0 === 1" class="flex-h" @click="SelectStore(item)">
@@ -102,6 +114,7 @@ export default {
102 114
   name: '',
103 115
   data () {
104 116
     return {
117
+      MyStoreList: [], // 我的店铺
105 118
       CurrentStoreName: null, // 当前选择店铺名称
106 119
       CurrentStoreId: null, // 当前选择店铺id
107 120
       RecommendStoreList: [], // 推荐店铺列表
@@ -135,6 +148,17 @@ export default {
135 148
     }).then((res) => {
136 149
       this.StoreList = res.data.data.nearest || []
137 150
       this.RecommendStoreList = res.data.data.recommend || []
151
+      this.MyStoreList = res.data.data.mine || []
152
+      if (this.MyStoreList.length) {
153
+        this.CurrentStoreName = this.MyStoreList[0].shopId === this.CurrentStoreId ? null : this.MyStoreList[0].name
154
+        this.CurrentStoreId = this.MyStoreList[0].shopId === this.CurrentStoreId ? null : this.MyStoreList[0].shopId
155
+      } else if (this.RecommendStoreList.length) {
156
+        this.CurrentStoreName = this.RecommendStoreList[0].shopId === this.CurrentStoreId ? null : this.RecommendStoreList[0].name
157
+        this.CurrentStoreId = this.RecommendStoreList[0].shopId === this.CurrentStoreId ? null : this.RecommendStoreList[0].shopId
158
+      } else if (this.StoreList.length) {
159
+        this.CurrentStoreName = this.StoreList[0].shopId === this.CurrentStoreId ? null : this.StoreList[0].name
160
+        this.CurrentStoreId = this.StoreList[0].shopId === this.CurrentStoreId ? null : this.StoreList[0].shopId
161
+      }
138 162
     })
139 163
   },
140 164
   mounted () {

+ 29
- 1
src/pages/index/LanQiuDingDan/index.vue Näytä tiedosto

@@ -75,6 +75,18 @@
75 75
 
76 76
         <div class="Layer" v-if="ShowStore">
77 77
           <div class="centerLabel">
78
+            <span v-if="MyStoreList.length">我的店铺:</span>
79
+            <ul v-if="MyStoreList.length">
80
+              <li v-for="(item, index) in MyStoreList" :key="index" class="flex-h" @click="SelectStore(item)">
81
+                <div class="flex-item">
82
+                  <div>
83
+                    <span>{{item.name}}</span>
84
+                  </div>
85
+                </div>
86
+                <i class="iconfont iconweigouxuan" v-if="item.shopId !== CurrentStoreId"></i>
87
+                <i class="iconfont iconyigouxuan active" v-else></i>
88
+              </li>
89
+            </ul>
78 90
             <span v-if="RecommendStoreList.length">推荐店铺:</span>
79 91
             <ul v-if="RecommendStoreList.length">
80 92
               <li v-for="(item, index) in RecommendStoreList" :key="index" class="flex-h" @click="SelectStore(item)">
@@ -122,6 +134,7 @@ export default {
122 134
   name: '',
123 135
   data () {
124 136
     return {
137
+      MyStoreList: [],
125 138
       PriceArr: [0, 0], // 奖金区间
126 139
       AllParts: [], // 投注生成结果
127 140
       CurrentPassUnitNum: 0,
@@ -172,7 +185,6 @@ export default {
172 185
     ]),
173 186
     Init () { // 初始化
174 187
       this.PageList = [...this.LanQiuCart] // 赋值页面数据
175
-      console.log(this.PageList)
176 188
       this.ToGetStoreList() // 获取店铺列表
177 189
       if (this.$route.query.type === 'single') { // 单关
178 190
         this.CurrentPassCode = '1*1'
@@ -233,6 +245,7 @@ export default {
233 245
       }).then((res) => {
234 246
         let StoreList = res.data.data.nearest || []
235 247
         let RecommendStoreList = res.data.data.recommend || []
248
+        let MyStoreList = res.data.data.mine || []
236 249
         StoreList.map((item) => {
237 250
           if (item.status - 0 === 1) {
238 251
             this.StoreList.push(item)
@@ -243,6 +256,21 @@ export default {
243 256
             this.RecommendStoreList.push(item)
244 257
           }
245 258
         })
259
+        MyStoreList.map((item) => {
260
+          if (item.status - 0 === 1) {
261
+            this.MyStoreList.push(item)
262
+          }
263
+        })
264
+        if (this.MyStoreList.length) {
265
+          this.CurrentStoreName = this.MyStoreList[0].shopId === this.CurrentStoreId ? null : this.MyStoreList[0].name
266
+          this.CurrentStoreId = this.MyStoreList[0].shopId === this.CurrentStoreId ? null : this.MyStoreList[0].shopId
267
+        } else if (this.RecommendStoreList.length) {
268
+          this.CurrentStoreName = this.RecommendStoreList[0].shopId === this.CurrentStoreId ? null : this.RecommendStoreList[0].name
269
+          this.CurrentStoreId = this.RecommendStoreList[0].shopId === this.CurrentStoreId ? null : this.RecommendStoreList[0].shopId
270
+        } else if (this.StoreList.length) {
271
+          this.CurrentStoreName = this.StoreList[0].shopId === this.CurrentStoreId ? null : this.StoreList[0].name
272
+          this.CurrentStoreId = this.StoreList[0].shopId === this.CurrentStoreId ? null : this.StoreList[0].shopId
273
+        }
246 274
       })
247 275
     },
248 276
     ToGetAllParts () { // 枚举投注