Chore:代码格式化&删除无用的文件

This commit is contained in:
lifizer
2024-03-27 17:55:22 +08:00
parent eb87337e70
commit cfd09436f1
5 changed files with 46 additions and 2991 deletions
-8
View File
@@ -856,14 +856,6 @@
"navigationBarTitleText": "文玩" "navigationBarTitleText": "文玩"
} }
}, },
{
"path": "views/store",
"style": {
"navigationBarTitleText": "文玩店铺详情",
"navigationStyle": "custom",
"navigationBarTextStyle": "white"
}
},
{ {
"path": "views/storeList", "path": "views/storeList",
"style": { "style": {
+37 -38
View File
@@ -126,13 +126,13 @@
</template> </template>
<script> <script>
import MescrollMixins from "@/mixins/mescroll-mixins.js"; import MescrollMixins from '@/mixins/mescroll-mixins.js'
import {fetchCity} from "@/api/wenwan"; import {fetchCity} from '@/api/wenwan'
import MescrollBody from "@/components/mescroll-uni/mescroll-body.vue"; import MescrollBody from '@/components/mescroll-uni/mescroll-body.vue'
import {getCurAddress, getLocation} from "@/utils/common.js"; import {getCurAddress, getLocation} from '@/utils/common.js'
export default { export default {
name: "choseCity", name: 'ChoseCity',
components: { components: {
MescrollBody MescrollBody
}, },
@@ -143,8 +143,7 @@ export default {
// 此时mescroll会携带page的参数: // 此时mescroll会携带page的参数:
// let pageNum = mescroll.num; // 页码, 默认从1开始 // let pageNum = mescroll.num; // 页码, 默认从1开始
// let pageSize = mescroll.size; // 页长, 默认每页10条 // let pageSize = mescroll.size; // 页长, 默认每页10条
mescroll.endSuccess(10)
mescroll.endSuccess(10);
} }
}) })
], ],
@@ -162,23 +161,23 @@ export default {
auto: true auto: true
}, },
listGroup: [], listGroup: [],
provinceName: "", provinceName: '',
listCity: [], listCity: [],
navActive: 0, navActive: 0,
keyword: "", keyword: '',
type: null, type: null,
location: "", location: '',
banner: {}, banner: {},
recommendInfo: null // 推荐信息 recommendInfo: null // 推荐信息
}; }
}, },
onLoad(options) { onLoad(options) {
this.type = Number(options.type); this.type = Number(options.type)
this.location = options.city; this.location = options.city
if (this.location === undefined) { if (this.location === undefined) {
this.getMapData(); this.getMapData()
} }
this.init(); this.init()
}, },
methods: { methods: {
reload() { reload() {
@@ -218,23 +217,23 @@ export default {
}) })
}, },
async getMapData() { async getMapData() {
const map = await getLocation(); const map = await getLocation()
if (map) { if (map) {
const {latitude, longitude} = map[1]; const {latitude, longitude} = map[1]
const address = await getCurAddress(latitude, longitude); const address = await getCurAddress(latitude, longitude)
this.location = address[1].data.result.ad_info.city; this.location = address[1].data.result.ad_info.city
} }
}, },
init() { init() {
fetchCity(this.type).then(res => { fetchCity(this.type).then(res => {
if (res.success) { if (res.success) {
this.listGroup = res.data.group; this.listGroup = res.data.group
if (this.listGroup.length > 0) { if (this.listGroup.length > 0) {
this.listCity = this.listGroup[0].city; this.listCity = this.listGroup[0].city
this.provinceName = this.listGroup[0].label; this.provinceName = this.listGroup[0].label
this.recommendInfo = this.listGroup[0].recommendInfo this.recommendInfo = this.listGroup[0].recommendInfo
this.banner = { this.banner = {
...this.listGroup[0], ...this.listGroup[0],
icon: this.listGroup[0].icon, icon: this.listGroup[0].icon,
url: this.listGroup[0].uniappUrl url: this.listGroup[0].uniappUrl
} }
@@ -243,18 +242,18 @@ export default {
}) })
}, },
asideTap(index) { asideTap(index) {
this.navActive = index; this.navActive = index
this.listCity = this.listGroup[index].city; this.listCity = this.listGroup[index].city
this.provinceName = this.listGroup[index].label; this.provinceName = this.listGroup[index].label
this.recommendInfo = this.listGroup[index].recommendInfo this.recommendInfo = this.listGroup[index].recommendInfo
this.banner = { this.banner = {
...this.listGroup[index], ...this.listGroup[index],
icon: this.listGroup[index].icon, icon: this.listGroup[index].icon,
url: this.listGroup[index].uniappUrl url: this.listGroup[index].uniappUrl
} }
//触发加载请求 // 触发加载请求
this.mescroll.scrollTo(0, 0); this.mescroll.scrollTo(0, 0)
this.mescroll && this.mescroll.resetUpScroll(false); this.mescroll && this.mescroll.resetUpScroll(false)
}, },
emptyClick: function () { emptyClick: function () {
//触发加载请求 //触发加载请求
@@ -262,9 +261,9 @@ export default {
}, },
search() { search() {
this.listGroup.findIndex((group, index) => { this.listGroup.findIndex((group, index) => {
let result; let result
group.city.forEach(item => { group.city.forEach(item => {
result = item.cityName.indexOf(this.keyword, 0); result = item.cityName.indexOf(this.keyword, 0)
if (result !== -1) { if (result !== -1) {
this.asideTap(index); this.asideTap(index);
return null; return null;
@@ -276,8 +275,8 @@ export default {
}) })
}, },
select(item) { select(item) {
if (this.type === 0 && item.hasData === 0) return; if (this.type === 0 && item.hasData === 0) return
if ((this.type === 1 || this.type === 2) && item.hasShop === 0) return; if ((this.type === 1 || this.type === 2) && item.hasShop === 0) return
uni.setStorageSync("cityName", item.cityName) uni.setStorageSync("cityName", item.cityName)
switch (this.type) { switch (this.type) {
@@ -285,20 +284,20 @@ export default {
uni.navigateTo({ uni.navigateTo({
url: `/pkg_product/views/nativeList?cityId=${item.cityId}` url: `/pkg_product/views/nativeList?cityId=${item.cityId}`
}) })
break; break
case 1: case 1:
uni.navigateTo({ uni.navigateTo({
url: `/wenwan/views/storeList?cityId=${item.cityId}` url: `/wenwan/views/storeList?cityId=${item.cityId}`
}) })
break; break
case 6: case 6:
uni.navigateTo({ uni.navigateTo({
url: `/pkg_product/views/scenicSpot?cityId=${item.cityId}` url: `/pkg_product/views/scenicSpot?cityId=${item.cityId}`
}) })
break; break
default: default:
uni.navigateBack() uni.navigateBack()
break; break
} }
}, },
goToStore(id) { goToStore(id) {
@@ -306,7 +305,7 @@ export default {
return return
} }
uni.navigateTo({ uni.navigateTo({
url: "/pagesInn/inn/innHome?id=" + id url: '/pagesInn/inn/innHome?id=' + id
}) })
}, },
goToGoods(productId) { goToGoods(productId) {
+9 -3
View File
@@ -210,9 +210,15 @@
<view class="service-section goods-section" v-if="storeInfo && storeInfo.isTickets!=1"> <view class="service-section goods-section" v-if="storeInfo && storeInfo.isTickets!=1">
<view class="cell flex jc-between ai-center" @click="changeCoupons()" v-if="couponList['usable'].length>0"> <view class="cell flex jc-between ai-center" @click="changeCoupons()" v-if="couponList['usable'].length>0">
<view> <view>
<text class="coupon-label tc" v-for="(item,index) in couponList.usable" :key="index" v-if="index<2"> <template v-for="(item, index) in couponList.usable">
{{ item.couponTitle }} <text
</text> v-if="index < 2"
:key="index"
class="coupon-label tc"
>
{{ item.couponTitle }}
</text>
</template>
</view> </view>
<view class="value">优惠详情 <view class="value">优惠详情
<uni-icons type="right" size="13" color="#707070"></uni-icons> <uni-icons type="right" size="13" color="#707070"></uni-icons>
File diff suppressed because it is too large Load Diff
File diff suppressed because it is too large Load Diff