diff --git a/manifest.json b/manifest.json index 1693faa..4f21729 100644 --- a/manifest.json +++ b/manifest.json @@ -2,8 +2,8 @@ "name" : "行走红色苏州", "appid" : "__UNI__511E818", "description" : "", - "versionName" : "1.0.1", - "versionCode" : 101, + "versionName" : "1.0.2", + "versionCode" : 102, "transformPx" : false, /* 5+App特有相关 */ "app-plus" : { diff --git a/pages/line/line.vue b/pages/line/line.vue index b755905..a45389f 100644 --- a/pages/line/line.vue +++ b/pages/line/line.vue @@ -38,7 +38,7 @@ - + {{pointer.name}} @@ -73,7 +73,8 @@ return { navBarTop: 0, listLine: [], - colorList: ['#dbd0ba','#ad6e46','#666d95','#6d7c4c'], + colorList: ['#dbd0ba','#ad6e46','#666d95','#6d7c4c'], + replaceImg:require('@/static/share.jpg') } }, @@ -102,8 +103,20 @@ sort_type:'ASC' // with_relations:['image'] }) + res.data.map((item,index)=>{ item.color = this.colorList[index%this.colorList.length] + let orderMap = item.pointer_list.reduce((acc, val, idx) => { + acc[val] = idx; + return acc; + }, {}); + item.pointer.sort((a, b) => { + // 获取a和b在arr中的索引,没有则视为最大索引+1 + let indexA = orderMap[a.id] !== undefined ? orderMap[a.id] : item.pointer_list.length; + let indexB = orderMap[b.id] !== undefined ? orderMap[b.id] : item.pointer_list.length; + // 按照索引升序排序 + return indexA - indexB; + }); }) this.listLine = res.data },